-
Notifications
You must be signed in to change notification settings - Fork 236
fix(picker): scrolling issue inside overlays in Safari iPad #5868
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: edd1dda The changes in this PR will be included in the next version bump. This PR includes changesets to release 78 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📚 Branch Preview🔍 Visual Regression Test ResultsWhen a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:
Deployed to Azure Blob Storage: If the changes are expected, update the |
…spectrum-web-components into rajdeep/ipad-scroll-issue
trim.2B4F5229-CADA-4597-9650-51F00C5F7E89.MOV |
Description
Picker menus inside overlays on Safari/iOS couldn't scroll to the bottom after selecting an item and reopening. The menu would appear truncated (90px height instead of the full 947px), making lower items inaccessible.
Root cause
A timing issue in
PlacementController: the overlay's height measurement occurred before the menu's scrollIntoView operation completed. Safari's layout engine needed an additional frame to fully render the menu after scroll repositioning, but computePlacement() was measuring prematurely, capturing the collapsed/transitional state rather than the final rendered height.Fix
Added a 1-frame requestAnimationFrame delay in PlacementController.computePlacement() specifically for:
This allows Safari's layout engine to complete
scrollIntoViewand stabilize the menu's rendered height before the overlay calculates positioning and applies size constraints.Why Safari-specific
Chrome's layout engine completes
scrollIntoViewsynchronously within the same frame, while Safari/WebKit requires an additional frame for the layout to settle. This is a known Safari rendering behavior, not a bug.Solution
PlacementController Timing Fix (
PlacementController.ts)Adds a 1-frame delay in PlacementController for Safari browsers when rendering picker menus inside overlays, allowing scrollIntoView to complete before height measurement. Excludes submenus to maintain hover responsiveness.
Motivation and context
Related issue(s)
Screenshots (if appropriate)
Author's checklist
Reviewer's checklist
patch,minor, ormajorfeaturesManual review test cases
Descriptive Test Statement
Descriptive Test Statement
Breaking Changes
None. This is a bug fix with no API changes.
Device review