Repository navigation
fix(a11y): keep visually hidden live regions fixed, so they never escape a scroll container - #138
Merged
Merged
Conversation
…ape a scroll container
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Merged
This branch was successfully deployed
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.
Problem
Buttonmakes its pending live region as a sibling of the<button>, visually hidden withposition: absolute. Inside a scroll container that is not positioned, that span is laid out against an ancestor outside the scroller. While the container scrolls, Chrome promotes the sticky content around it (a page header) to its own compositing layer to keep the span in place, and the header text loses subpixel anti-aliasing (greyscale text). A probe in a consumer app showed thatposition: fixedon those spans restores the baseline exactly.Fix
primitives/visually-hidden.ts(position: fixed; top: 0; left: 0plus the usual clip). This is the style thatCombobox.Status,Autocomplete.Status,TransferList.Status,TableandToastalready used, each with its own copy (or fromtable/utils).Button,Dropzoneand theTimePickerwheel column live regions move from their inline absolute style to the shared one. TheButtonlive region stays a sibling: inside the button its text would join the accessible name.table/utils/visually-hidden-style.tsare replaced by the shared module.position: absoluteon purpose: the browser anchors its validation bubble to them.Tests
visually-hidden.test.tsfor the shared style.button.test.ts: the live region computes toposition: fixed.vitest(2225 tests) and the SSR suite pass locally.🤖 Generated with Claude Code