Repository navigation
Reuse the existing SearchBar in Stack v5 headers #4681
juliusmarminge
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
V5 Stack headers currently only accept header item/spacer children, so the existing SearchBar cannot attach its UISearchController to the v5 UINavigationItem.
I propose an iOS-only
Stack.HeaderConfigoption,ios.searchBar, accepting the existing<SearchBar />element. This follows the platform-specific v5 header configuration and preserves SearchBar props, events and ref commands. The native coordinator would attach/detach the search controller, refresh navigation-item options when SearchBar props change, and deactivate removed/replaced controllers. tvOS would ignore this option, as in the legacy header.This first change would not add toolbar items, automatic search activation, or new SearchBar props. Johan Kasperi's #4013 already proposes legacy stack toolbars, Marco de Jongh's #4131 covers native-tabs search toolbars, and Konrad Michalik's #4679 covers UISearchTab. I would leave those concerns with their authors.
React Navigation's new native-stack adapter is still in #13115. A companion change there can map its existing headerSearchBarOptions to ios.searchBar without introducing another downstream option. I plan a minimal complete scenario and native before/after captures, including focus commands, filter menu actions, replacement/removal, and push/pop.
Does this fit the v5 header direction?
All reactions