mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-07-30 18:19:36 +00:00
ios: fix add members search keyboard focus (#4934)
* ios: fix add members search keyboard focus * use -1 as ID --------- Co-authored-by: Evgeny Poberezkin <evgeny@poberezkin.com>
This commit is contained in:
co-authored by
Evgeny Poberezkin
parent
6e5eb697a2
commit
9199fbffd5
@@ -105,8 +105,10 @@ struct AddGroupMembersViewCommon: View {
|
||||
.padding(.leading, 2)
|
||||
let s = searchText.trimmingCharacters(in: .whitespaces).localizedLowercase
|
||||
let members = s == "" ? membersToAdd : membersToAdd.filter { $0.chatViewName.localizedLowercase.contains(s) }
|
||||
ForEach(members) { contact in
|
||||
contactCheckView(contact)
|
||||
ForEach(members + [dummyContact]) { contact in
|
||||
if contact.contactId != dummyContact.contactId {
|
||||
contactCheckView(contact)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -130,6 +132,14 @@ struct AddGroupMembersViewCommon: View {
|
||||
.modifier(ThemedBackground(grouped: true))
|
||||
}
|
||||
|
||||
// Resolves keyboard losing focus bug in iOS16 and iOS17,
|
||||
// when there are no items inside `ForEach(memebers)` loop
|
||||
private let dummyContact: Contact = {
|
||||
var dummy = Contact.sampleData
|
||||
dummy.contactId = -1
|
||||
return dummy
|
||||
}()
|
||||
|
||||
private func inviteMembersButton() -> some View {
|
||||
Button {
|
||||
inviteMembers()
|
||||
|
||||
Reference in New Issue
Block a user