Replace searchable modifiers with a custom implementation using UISearchController. (#2209)

Unfortunately the introspection became unreliable from iOS 17.1 onwards.

* Replace disableInteractiveDismissOnSearch and dismissSearchOnDisappear.

These can be handled within our searchController implementation now.

* Fix preview snapshots.

Weirdly, the search field is bigger in these, although it hasn't changed in the UI tests or the app itself.
This commit is contained in:
Doug
2023-12-06 17:43:55 +00:00
committed by GitHub
parent 6cd25fac50
commit e8b446c909
8 changed files with 152 additions and 53 deletions
@@ -31,10 +31,10 @@ struct InviteUsersScreen: View {
.navigationTitle(L10n.screenCreateRoomAddPeopleTitle)
.navigationBarTitleDisplayMode(.inline)
.toolbar { toolbar }
.disableInteractiveDismissOnSearch()
.dismissSearchOnDisappear()
.searchable(text: $context.searchQuery, placement: .navigationBarDrawer(displayMode: .always), prompt: L10n.commonSearchForSomeone)
.searchableConfiguration(hidesNavigationBar: false)
.searchController(query: $context.searchQuery,
placeholder: L10n.commonSearchForSomeone,
showsCancelButton: false,
disablesInteractiveDismiss: true)
.compoundSearchField()
.alert(item: $context.alertInfo)
}