Skip to content

Conversation

@engijlr
Copy link
Contributor

@engijlr engijlr commented Dec 2, 2025

Summary

  • Move screen reader live region from Shadow DOM to Light DOM (document.body) - Chrome doesn't reliably detect ARIA live regions inside Shadow DOM
  • Use role="alert" with fresh elements for each announcement instead of updating text content of an existing live region
  • Fix invalid aria-role="true" attribute (was invalid HTML)

Root Cause

The previous implementation had the live region nested 3 levels deep in Shadow DOM:
→ shadow-root → → shadow-root → #sr-live

Chrome doesn't reliably detect ARIA live regions inside Shadow DOM, while Safari is more forgiving. Creating a new alert element in Light DOM for each announcement is the most reliable method across
browsers.

References

Test plan

  • Run application and trigger toast notifications (e.g., save content)
  • Test with VoiceOver + Chrome on macOS - notifications should be announced
  • Test with VoiceOver + Safari on macOS - notifications should be announced

🤖 Generated with Claude Code

engijlr and others added 3 commits December 2, 2025 12:48
- Move screen reader live region from Shadow DOM to Light DOM (document.body)
  Chrome doesn't reliably detect ARIA live regions inside Shadow DOM
- Use role="alert" with fresh elements for each announcement instead of
  updating text content of an existing live region
- Fix invalid aria-role="true" attribute (was invalid HTML)
- Fix missing backslash in unicode escape '\u00A0'

The previous implementation had the live region nested 3 levels deep in
Shadow DOM, which Safari handled but Chrome ignored. Creating a new
alert element in Light DOM for each announcement is the most reliable
method across browsers.

Closes #14521

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@nielslyngsoe nielslyngsoe changed the title Notification Container: Fix toast notifications not announced by screen readers in Chrome. Notification Container: Make toast notifications announced by screen readers in Chrome. Dec 2, 2025
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.

2 participants