Repository navigation
fix: keep one screen reader route announcement - #47
Merged
Merged
Conversation
astro announces each page in a new live region and relies on swapping the whole body to drop the last one. the custom swap only replaces the content, so every visited title stayed behind for screen readers
|
Deploy preview for y-fu ready!
Deployed with vercel-action |
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.
Found by an independent review of #45 and reproduced on temple.yearn.fi. Astro's client router announces each new page in a fresh
aria-live="assertive".astro-route-announcerelement, relying on the default swap (which replaces<body>) to drop the old one. Our custom swap replaces only#content, so the announcers piled up: after three page changes there were three hidden live regions, and a screen reader reading to the end of the page heard every visited title.The custom swap now removes the previous announcer before Astro adds the new one.
Checked on a local build: after five page changes and a back there's exactly one announcer, holding the current title, with no console errors. Lint,
astro checkand the build pass.