Skip to content

Fix measurement of viewport with position: fixed - #965

Merged
inokawa merged 2 commits into
inokawa:mainfrom
yunfeizhu:fix/fixed-position-viewport
Sep 11, 2026
Merged

inokawa merged 2 commits into
inokawa:mainfrom
yunfeizhu:fix/fixed-position-viewport

Conversation

@yunfeizhu

Copy link
Copy Markdown
Contributor

Fixes #964.

A VList used directly as a fixed-position picker renders an empty viewport. Its offsetParent is 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 offsetParent fast 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 under display: 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.
  • TypeScript, Svelte and Angular checks, lint, build, size limits and formatting pass. Lint and Svelte checks still report existing warnings.
  • npm run e2e -- --workers=2 on macOS: 179 passed, 11 failed. Three failed cases pass on rerun with the fix. The other eight also fail in an unchanged checkout of d6b315af1c244f0c843167d04ec045edcd164dd8; 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).

@inokawa inokawa changed the title Fix measurement of fixed-position viewports Fix measurement of viewport with position: fixed Sep 11, 2026
@inokawa
inokawa merged commit 1b83b98 into inokawa:main Sep 11, 2026
2 checks passed
@inokawa

inokawa commented Sep 11, 2026

Copy link
Copy Markdown
Owner

Published in 0.51.3. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VList renders no items when its viewport uses position: fixed

2 participants