Repository navigation
fix(scroll lock, modal): leave revealing the focused field above the iOS keyboard to Safari - #729
Merged
Merged
Conversation
…iOS keyboard to Safari Page scroll lock on iOS goes back to overflow only, like Base UI's lock for overlay scrollbars: it no longer focuses the pressed fields itself, reveals them in their scroll container or puts back the page Safari panned. Modal no longer ends above the on-screen keyboard. Both raced Safari's own panning, which left the modal content moving between the positions each resolved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKGZMmVFz6mwWJsnAQRqoY
size-limit 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.
Summary
Removes the custom on-screen keyboard handling added in #720, #723 and #727. It raced Safari's own panning, so focusing fields in a modal moved the content around: the modal top got cut off, a gap opened above the keyboard, and the page jumped back.
This follows Base UI's default
useScrollLock. On iOS, and with overlay scrollbars, it only sets overflow on the viewport scroller. Its comment explains the choice: fields must still scroll into view natively, and the toolbar must not force itself into view.lockSafari.ts): back to overflow only.scroll/keyboardPan.ts(preventKeyboardPan) and its tests are deleted. That module focused pressed fields with a geometry override, put a panned page back and revealed fields inside their own scroll container.Modal: no longer ends above the keyboard.--rs-modal-keyboardand--rs-modal-keyboard-heightare gone, and so is the bottom safe area reduced by the keyboard. The modal CSS is back to its state before feat: useVirtualKeyboard hook, Modal bottom safe area under the keyboard #720, apart from the unrelated swipe and sheet changes made since.useVirtualKeyboardstays public, for apps that position their own content above the keyboard (Untap's action bar does).The Modal browser test now checks that the modal stays in place when the visual viewport shrinks for the keyboard.
Changesets
modal-keyboard-inset,modal-keyboard-safe-areaandscroll-lock-keyboard-panwere only released in canaries. They are removed from.changeset/and frompre.json, so the stable changelog doesn't describe behavior that no longer exists. A newnative-keyboard-revealchangeset tells canary users what changed.Related Issue
Messy focus and panning in iOS Safari with a modal open (screen recording from Untap).
Screenshots / Recordings
None. The behavior only shows on an iOS device with the on-screen keyboard.
Notes for Reviewers
src/scrollandsrc/viewport, browser tests for Modal, Overlay and hooks, Modal stories,tscandpnpm lint.Generated by Claude Code