fix: keyboard jump on samsung non edge-to-edge devices#3718
Merged
Conversation
Contributor
SDK Size
|
oliverlaz
approved these changes
Jul 9, 2026
Contributor
|
🎉 This PR is included in version 9.6.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
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.
🎯 Goal
This PR fixes a transient issue on
Android, opening the keyboard inside a channel could make the composer and the message list briefly shoot up to a random high point and then drop back down onto the keyboard. It's most obvious on Samsung (Android 13) and it's intermittent, since it comes down to timing.KeyboardCompatibleViewcalculates a JS offset to lift the composer above the keyboard. But on a non edge-to-edge app the OS is already doing that for us withadjustResizeand it shrinks the window when the keyboard shows up. The catch is our layoutframeonly reflects that resize one render afterkeyboardDidShowfires, so for a frame or two we compute the offset from the old, full height frame and stack it on top of the native resize. That extra offset is the jump we see.🛠 Implementation details
I split the behaviour based on whether the OS resizes the window for the keyboard:
0and letadjustResizehandle it. No double offset, nothing to race against, no jump.The annoying part is you can't tell those two apart from
screen - windowon its own. Below API 35 the system bars get reported as an inset in both modes, so a plainscreen - window > 0check wrongly triggers under edge-to-edge and ends up hiding the composer behind the keyboard. So on top of the inset check we read RN'sisEdgeToEdge,DeviceInfoflag, and we only skip the JS offset when there's a bar inset (room foradjustResizeto shrink into) and the app isn't edge-to-edge.The table below provides a report of where and how this has been tested on:
edgeToEdgeEnabled=true)Opened and closed the keyboard a bunch of times on each to make sure the jump is gone and nothing regressed.
🎨 UI Changes
iOS
Android
🧪 Testing
☑️ Checklist
developbranch