Skip to content

hide modal siblings from screen reader#11247

Merged
riknoll merged 1 commit into
masterfrom
dev/riknoll/microbit-hide-modal-siblings
Apr 3, 2026
Merged

hide modal siblings from screen reader#11247
riknoll merged 1 commit into
masterfrom
dev/riknoll/microbit-hide-modal-siblings

Conversation

@riknoll
Copy link
Copy Markdown
Member

@riknoll riknoll commented Apr 3, 2026

fixes microsoft/pxt-microbit#6740

this PR does two things:

  • makes it so that modals now render in document.body by default rather than in the root div
  • adds behavior to our common modal to add aria-hidden to all sibling elements when rendering

the first change effectively undoes this one because it's no longer necessary; at some point in the theme work we moved the .hc class up to the document body so modals no longer need to be within root to get the high contrast css

the second change addresses the actual issue. while i don't love it (feels kind of hacky) this seemed like the most elegant way to have this behavior immediately reflected in all of our webapps without having to pass an array of elements into each instance of the Modal component. hiding just the #content div was probably insufficient anyhow since there are other children of document.body that could contain interactable elements like Blockly's widgetdiv and dropdowndiv

@microbit-matt-hillsdon @microbit-robert FYI

@riknoll riknoll requested a review from a team April 3, 2026 17:59
@riknoll riknoll merged commit 9298c79 into master Apr 3, 2026
20 checks passed
@riknoll riknoll deleted the dev/riknoll/microbit-hide-modal-siblings branch April 3, 2026 18:34
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.

Screen readers can view / focus content behind some modals / dialogs

2 participants