fix(iOS, Stack v4): fix missing search bar on root screen on iOS 26 #3098
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes missing search bar on root screen on iOS 26. (Part of https://github.com/software-mansion/react-native-screens-labs/issues/331).
The search bar is missing on root screen on iOS 26 beta 4 (only on iPhones). I wasn't able to reproduce this issue in bare UIKit app.
I found that on iOS 26, there are new properties for search bar, including searchBarPlacementAllowsToolbarIntegration. Setting this prop to
falsefixes the issue. I am not 100% sure what is the intended use case for this prop. If I understand correctly (but I might be wrong here), if this is set totrueandpreferredSearchBarPlacementis set tointegratedorintegratedButton, then you can use search bar button from searchBarPlacementBarButtonItem to place it insidetoolbarItemsin a position you want, but in our case, bothpreferredSearchBarPlacementandsearchBarPlacementare set toUINavigationItemSearchBarPlacementStackedso this does not add up.This might be a bug because even in the most recent release notes for iOS 26 beta 4, some workarounds connected to this prop are mentioned:
Changes
searchBarPlacementAllowsToolbarIntegrationtoNOScreenshots / GIFs
before_searchbar.mov
after_searchbar.mov
Test code and steps to reproduce
Run
Test758. You should be able to use search bar on the root screen.Checklist