Questions tagged [.searchable]
7 questions
3
votes
0 answers
Searchable: Suggested Tokens not Disappearing on Submit
Using the searchable view modifier with tokens allows me to present the user with search suggestions. When the search field is activated, the list of suggested tokens is presented on top of the list view (containing the results). Once tokens are…

Cheezzhead
- 298
- 1
- 8
3
votes
1 answer
Search Bar is briefly visible when navigating with NavigationStack (SwiftUI)
I have a .searchable modifier on a list where I navigate to with new NavigationStack. However when the view loads the search box is briefly visible which looks weird. Am I using the navigation stack incorrectly or is this some kind of bug?
Here is…

Can Celik
- 2,050
- 21
- 30
1
vote
1 answer
Is there a way to hide the search bar in SwftUI
I have a view with the searchable modifier. It is always displaying a searchBar and works fine.
I find the searchBar is taking up too much space at the top of the view on an iPhone and since it is not used often, I want to only have a magnifying…

alionthego
- 8,508
- 9
- 52
- 125
1
vote
2 answers
.searchable() - make the search box stick to the top without moving when focused
I am trying to make the search box in .searchable stick to the top without moving when there is no navigationBarTitle. Basically, when the box gets focused, there is an animation that moves the box upward and I would like to prevent that from…

lagoupo
- 25
- 7
1
vote
1 answer
Changing the color of .searchable() elements
I am using the .searchable() modifier on a NavigationStack. I want to change the color of the cancel button as it does not match with my app colors. How can I do this?
This is what I already tried without luck:
accentcolor, tint, foregroundcolor,…

lagoupo
- 25
- 7
1
vote
5 answers
Show .searchable search bar only when pulling down
So I have an SwiftUI view, that displays data in a List. You can search and filter through the objects.
So far so easy, but this searchbar (initializised with .searchable()) is always visible. Only when you scroll down the list it disappears. How…

Black Fox
- 23
- 8
0
votes
0 answers
on macOS a DisclosureGroup inside List crashes with .searchable
On macOS I get an unexpected crash with the following code when entering a search that is not in the data (e.g. "100"). It does NOT crash on iOS with the same code.
Any hints appreciated.
struct ContentView: View {
let data: [Int] =…

ChrisR
- 9,523
- 1
- 8
- 26