diff options
| author | Fuwn <[email protected]> | 2025-06-14 08:11:55 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-06-14 08:11:55 -0700 |
| commit | 92d5c525d1f5aa83af4504a7ae20043355a895c7 (patch) | |
| tree | 0a848e6758d839fd4899b2b1cb4f8547307031e4 /Sora/Views/Post/Grid/PostGridView.swift | |
| parent | feat: Development commit (diff) | |
| download | sora-testing-92d5c525d1f5aa83af4504a7ae20043355a895c7.tar.xz sora-testing-92d5c525d1f5aa83af4504a7ae20043355a895c7.zip | |
feat: Development commit
Diffstat (limited to 'Sora/Views/Post/Grid/PostGridView.swift')
| -rw-r--r-- | Sora/Views/Post/Grid/PostGridView.swift | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Sora/Views/Post/Grid/PostGridView.swift b/Sora/Views/Post/Grid/PostGridView.swift index 9fd384c..165ac01 100644 --- a/Sora/Views/Post/Grid/PostGridView.swift +++ b/Sora/Views/Post/Grid/PostGridView.swift @@ -7,6 +7,7 @@ struct PostGridView: View { @State private var isSearchHistoryPresented = false @Binding var selectedTab: Int @State private var viewStates: [UUID: PostGridViewState] = [:] + @State private var isSearchablePresented = false @Environment(\.isSearching) private var isSearching @@ -43,7 +44,7 @@ struct PostGridView: View { .clipped() } } - .searchable(text: $manager.searchText, prompt: "Tags") + .searchable(text: $manager.searchText, isPresented: $isSearchablePresented, prompt: "Tags") .searchSuggestions { if settings.searchSuggestionsMode != .disabled { SearchSuggestionsView( @@ -58,8 +59,8 @@ struct PostGridView: View { .navigationDestination(for: BooruPost.self) { post in PostDetailsView(post: post) } - .onChange(of: manager.searchText) { _, _ in - if manager.searchText.isEmpty, !isSearching, !manager.isNavigatingHistory { + .onChange(of: isSearchablePresented) { _, isPresented in + if !isPresented, manager.searchText.isEmpty, !manager.isNavigatingHistory { manager.performSearch() } } |