Repository navigation
Fix measurement of viewport with position: fixed - #965
Merged
Merged
Conversation
inokawa
approved these changes
Sep 11, 2026
position: fixed
Owner
|
Published in |
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.
Fixes #964.
A
VListused directly as a fixed-position picker renders an empty viewport. ItsoffsetParentis null even while it is visible, so the ResizeObserver callback skips its measurement and the store never leaves the initial empty range.Keep the existing
offsetParentfast path, but check for client rects before discarding a target with no offset parent. This lets visible fixed-position viewports initialize while continuing to ignore elements underdisplay: none. Apply the same guard to the container, window and grid drivers.Browser regression tests cover initial rendering and scrolling for fixed React lists and grids in Chromium, Firefox and WebKit, plus a fixed Vue list in Chromium. Relative and absolute list viewports are included as controls. Against unchanged
d6b315af1c244f0c843167d04ec045edcd164dd8, the seven fixed-position cases fail and the six control cases pass; all 13 pass with the fix.Validation:
npm test: 213 passed.npm run test:browser: 82 passed, 4 skipped, including the existing hidden-element tests.npm run e2e -- --workers=2on macOS: 179 passed, 11 failed. Three failed cases pass on rerun with the fix. The other eight also fail in an unchanged checkout ofd6b315af1c244f0c843167d04ec045edcd164dd8; these concern existing scroll alignment, dynamic-image and scroll-compensation tests. The WebKit window-scroll failure is intermittent on the baseline as well (one failure and two passes across three runs, with the same 1px mismatch).