fix: don't modify edge-to-edge mode by default when module toggled on/off#1412
Merged
kirillzyusko merged 6 commits intomainfrom Apr 10, 2026
Merged
fix: don't modify edge-to-edge mode by default when module toggled on/off#1412kirillzyusko merged 6 commits intomainfrom
kirillzyusko merged 6 commits intomainfrom
Conversation
Contributor
📊 Package size report
|
2236248 to
b09609a
Compare
|
I have verified that this fixes the edge-to-edge issues we were seeing (titles of screens being under the status bar) with Android 15 and 16. |
|
This fixed it for me aswell. Can we get it merged? |
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Don't hook up in insets calculation since it infers with many other libraries (such as
react-native-screens,react-native-safe-area-contextand other native libs such as RevenueCat paywalls).💡 Motivation and Context
Original code has been introduced in #227
The idea was simple - to use this library we need:
So when we turn off functionality we need:
However there was one problem - when we were disabling edge-to-edge we saw a visual jump:
telegram-cloud-document-2-5440655251046692537.mp4
That was caused by
@react-navigation/stack+react-native-safe-area-context. Thereact-native-safe-area-contextwas emitting "wrong" events (we expected0insets):This is why I added a code with nulling insets. However it opens new issues like #1292 or #1013
In this PR I'm revisiting the implementation and I do one small trick: now we will not toggle
edge-to-edgemode (in Android 16 it's enabled by default anyway without ability to turn it off) - instead we'll apply bottom padding/margin when keyboard appears (only when module turned off and input mode=resize, since resize + edge-to-edge acts as a adjustNothing). Yes, this is effectively a simulation of pre-edge-to-edge behavior and this simulation may not work everywhere perfectly (for example Android 16 would act differently before, since edge-to-edge is not disableable and even if you turn off the mode the keyboard wouldn't resize the window - with this solution it will, but at the same it bring consistency and reduces API fragmentation which is also good).I don't think this is a breaking change, so it can be published as a patch release 🤞
Closes #1292 #1013
Possibly #1179 #1192
📢 Changelog
Android
replaceStatusBarInsets;windowSoftInputMode;windowSoftInputModeextension inKeyboardControllerModuleImplfile;replaceStatusBarInsetsin globalsetOnApplyWindowInsetsListener(rootView);edge-to-edgemode;ADJUST_RESIZEmode is active andpreserveEdgeToEdgeisfalse;🤔 How Has This Been Tested?
Tested manually on Pixel 7 Pro (API 36).
📸 Screenshots (if appropriate):
📝 Checklist