mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-06 04:18:31 +00:00
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:
@@ -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)
|
||||
}
|
||||
|
||||
@@ -57,8 +57,7 @@ struct MessageForwardingScreen: View {
|
||||
.disabled(context.viewState.selectedRoomID == nil)
|
||||
}
|
||||
}
|
||||
.searchable(text: $context.searchQuery, placement: .navigationBarDrawer(displayMode: .always))
|
||||
.searchableConfiguration(hidesNavigationBar: false)
|
||||
.searchController(query: $context.searchQuery, showsCancelButton: false)
|
||||
.compoundSearchField()
|
||||
.disableAutocorrection(true)
|
||||
}
|
||||
|
||||
+2
-2
@@ -260,9 +260,9 @@ struct NotificationSettingsScreen_Previews: PreviewProvider, TestablePreview {
|
||||
|
||||
static var previews: some View {
|
||||
NotificationSettingsScreen(context: viewModel.context)
|
||||
.snapshot(delay: 0.1)
|
||||
.snapshot(delay: 2.0)
|
||||
NotificationSettingsScreen(context: viewModelConfigurationMismatch.context)
|
||||
.snapshot(delay: 0.1)
|
||||
.snapshot(delay: 2.0)
|
||||
.previewDisplayName("Configuration mismatch")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,10 +34,10 @@ struct StartChatScreen: View {
|
||||
.navigationTitle(L10n.actionStartChat)
|
||||
.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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user