Skip to content

fix(RAC): use ICB size as the fallback value for visual viewport#9384

Merged
snowystinger merged 3 commits intoadobe:mainfrom
lixiaoyan:patch-9
Jan 30, 2026
Merged

fix(RAC): use ICB size as the fallback value for visual viewport#9384
snowystinger merged 3 commits intoadobe:mainfrom
lixiaoyan:patch-9

Conversation

@lixiaoyan
Copy link
Contributor

@lixiaoyan lixiaoyan commented Dec 19, 2025

According to the specification, the visual viewport size excludes the scrollbar. Instead of window.innerWidth/Height, the fallback value should be document.documentElement.clientWidth/Height, which is the same as the ICB size and almost equivalent to the visual viewport size, which excludes the scrollbar.

It's mainly a fix about code correctness, as the VisualViewport is widely supported today.

See: https://drafts.csswg.org/cssom-view/#visualViewport

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

@lixiaoyan
Copy link
Contributor Author

lixiaoyan commented Jan 7, 2026

Edited: I've updated the PR description.


Original post

@snowystinger This PR is primarily about correctness. It may not address any real-world issues because the VisualViewport is widely supported today.

# Conflicts:
#	packages/@react-aria/utils/src/useViewportSize.ts
Copy link
Member

@snowystinger snowystinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Team, do we care about the fallback for this?

discussed, this is fine to go in

@snowystinger snowystinger added this pull request to the merge queue Jan 29, 2026
Merged via the queue into adobe:main with commit 1f85ed8 Jan 30, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants