Repository navigation
Conversation
…while the keyboard is visible The ScrollView only applied or removed its keyboard inset in response to a UIKeyboardWillChangeFrameNotification. Turning the prop on while the keyboard was up gave no inset until the keyboard moved again, and turning it off left the inset in place for good, since the hide notification was ignored too. Remember the keyboard's end frame from every notification, and when the prop changes while the keyboard is visible, apply the inset as if the keyboard had just appeared, or remove it and clamp the content offset. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 21, 2026
This branch has not been deployed
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.
Summary:
ScrollView'sautomaticallyAdjustKeyboardInsetsonly applied or removed the keyboard inset in response to aUIKeyboardWillChangeFrameNotification._keyboardWillChangeFrame:returns early while the flag is off, andupdatePropsonly stores the flag's new value. So changing the prop while the keyboard is already on screen does nothing:We hit the first case in the Bluesky app. Our bottom sheets turn the prop on only once the sheet reports it's at its full-height detent, which arrives as an event from native. A sheet with an autofocused
TextInputraises the keyboard during presentation, before that event lands, so the sheet couldn't scroll to its submit button.This change:
_keyboardWillChangeFrame:into_adjustInsetsForKeyboardEndFrame:keyboardBeginFrame:duration:curve:, unchangedupdatePropssees the prop change and the view is in a window with the keyboard visible:contentInset(and the vertical indicator insets) to thecontentInsetprop, then clamps the content offset to the smaller scrollable range throughscrollTo:.super updateProps:, so it sees the newcontentInsetprop, which is applied earlier inupdateProps.If the keyboard is hidden, or the view isn't in a window yet (e.g. a recycled view getting its props before it's mounted), nothing changes, and the next keyboard notification is handled as before.
Fixes #59305
Changelog:
[IOS] [FIXED] -
ScrollViewnow applies or removes its keyboard inset whenautomaticallyAdjustKeyboardInsetschanges while the keyboard is visibleTest Plan:
With the repro from #59305 (https://github.com/mozzius/scrollview-keyboard-insets-repro). Its
fixedbranch applies this exact change to RN 0.88.0 built from source (RCT_USE_PREBUILT_RNCORE=0). iPhone 17 simulator, iOS 26.5, Release, keyboard height 335pt.contentInset.bottomas reported byonScroll:Also with this change:
RNTester's ScrollView "Keyboard Insets" example already has a Switch for
automaticallyAdjustKeyboardInsets, so the same steps should show it there: focus an input, then flip the Switch. I tested with the standalone repro rather than RNTester.clang-format(the repo's pinned 21.1.2) makes no changes. The repro's patch is the same change applied to 0.88.0, where one hunk needed rebasing by hand around a line that only exists onmain.Related:
contentInsetAdjustmentBehavior="automatic", in the offset clamping.prepareForRecycle, which this change doesn't touch.🤖 Generated with Claude Code