Search bar on Android incorrectly adjusts other header elements when open
See original GitHub issueDescription
On Android, the search bar does not properly adjust header elements.
- Elements placed via
headerRight
are “pushed” out of the way and to the left of the search bar - If there are any elements placed via
headerLeft
, both the screen title and said elements are not adjusted at all and appear under the search bar
Screenshots


Steps To Reproduce
- Add a search bar to the header by specifying
headerSearchBarOptions
- Add any element(s) via the
headerLeft
navigation option - (Optional) Add any elements to the
headerRight
navigation option - Open the search bar on android
Expected behavior
- The header buttons on both the left side and the right side should no longer be visible.
- The search bar should appear as the only element in the header.
- The input should be unobstructed.
Actual behavior
- Any elements placed via
headerRight
seem to get “pushed” out of the way to the left of the search bar - The screen title as well as any elements placed by
headerLeft
are not adjusted and appear under the search bar
Reproduction
https://snack.expo.dev/@nrwinner/android-search-bug---react-native-screens-repro
Platform
- iOS
- Android
- Web
- Windows
- tvOS
Workflow
- Managed workflow
- Bare workflow
Package versions
package | version |
---|---|
react-native | 0.68.1 |
@react-navigation/native | 6.0.2 |
@react-navigation/native-stack | 6.1.0 |
react-native-screens | 3.13.1 |
react-native-safe-area-context | 4.2.4 |
expo | 45.0.0 |
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Toolbar overlapping below status bar - android - Stack Overflow
Use android:fitsSystemWindows="true" in the root view of your layout (LinearLayout in your case).
Read more >12 fast fixes for common Android problems - Computerworld
Solve annoying issues and get any phone in tip-top shape with these easy-to-implement, expert-approved solutions.
Read more >Handling common HTML and CSS problems - MDN Web Docs
Use this page, or another site that has a prominent heading or other block-level element. Right/Cmd + click on the element in question...
Read more >Security tips - Android Developers
The most common security concern for an application on Android is whether the data that you save on the device is accessible to...
Read more >Content Jumping (and How To Avoid It) | CSS-Tricks
It's especially common with ads but can happen with any layout-affecting content that loads after initial render, including images or even fonts ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I can confirm this issue. Forced me to remove searchHeader completely
You can try to place component on headerRight instead of headerLeft and add marginRight to it : const {width} = Dimensions.get(‘screen’); … headerRight:() => <FiltersHeader contentContainerStyle={{marginRight: width - 110}} />
https://user-images.githubusercontent.com/69375560/194675879-283f5e0a-478b-439e-bda7-ea160f3fb689.mp4