fix: dynamic bottomOffset over-scrolling#1204
Merged
kirillzyusko merged 3 commits intomainfrom Nov 14, 2025
Merged
Conversation
Contributor
📊 Package size report
|
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
Fixed an issue when change of
bottomSheetwith opened keyboard leads to unexpectedly big scroll.💡 Motivation and Context
The issue is that our
point/relativeScrollToremains the same. But when we focus our input we getscrollPosition.value === 0. When scrolling has completed we update that value to an actual scroll position (let's say to 209). WhenbottomOffsetgets changed we scroll from current position (rememberpointhasn't been changed) but we add already scrolled distance and we get an incorrect offset.To overcome this issue we need to reset our scroll position to "unscrolled" state. In fact we already use that pattern with scroll restoration (change scroll position, call
maybeScroll, restore position). So I decided to create a utility function calledperformScrollWithRestorationthat will substitute scroll to a new position, do a scrolling and restore original position.The fix is working well, it fixes a problem in example app and e2e tests successfully pass 🤞
Closes #1203
📢 Changelog
JS
performScrollWithRestorationutility function;performScrollWithRestorationwhenbottomOffsetgets changed (passingscrollBeforeKeyboardMovementvalue).🤔 How Has This Been Tested?
Tested manually in Fabric example, iPhone 16 Pro (iOS 26.0).
📸 Screenshots (if appropriate):
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-11-13.at.10.40.52.mov
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-11-13.at.10.39.53.mov
📝 Checklist