-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[material-ui][Backdrop] Add aria-hidden by default #34691
base: master
Are you sure you want to change the base?
Conversation
@@ -37,6 +37,7 @@ const ModalRoot = styled('div', { | |||
const ModalBackdrop = styled(Backdrop, { | |||
name: 'MuiModal', | |||
slot: 'Backdrop', | |||
'aria-hidden': true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'aria-hidden': true, |
You need to add this where ModalBackdrop
is used, what you are doing here doesn't make sense as the API is not supported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be updated to use the new suggested format now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good, but should we consider them breaking changes and hold off till v6? cc @michaldudak what do you think?
I suppose so. If an application relies on a Backdrop being excluded from the a11y tree, it may become much harder or impossible to navigate with screen readers after this change. |
@DiegoAndai, should we consider including this fix in v6? |
Thanks for the callout @ZeeshanTamboli! I wonder if we should do it, considering :
What do you think? @colmtuite @michaldudak, is there a plan to add a Backdrop component to Base UI alongside the Dialog? If so, would/should the Backdrop component have |
@DiegoAndai Our Dialog API design doc was just started this week and is still in early draft mode, so I can't be sure. Currently, there's no However, I'm almost certain we will include a |
I agree it would be better to take this into account when building it with the new Base UI (depending on what Base UI does). |
I added this to the Material UI with Base UI milestone to keep coordination between both. We can keep it on hold, and revisit it when we do that refactor. I added a comment with the workaround to the issue. |
This PR aims to solve Issue 33146 In which having the
aria-hidden
value on all Backdrops is no longer indented and instead it should only exist on the Backdrop that is behind a Modal. This is achieved by passing thearia-hidden: true
value to the Modal's custom Backdrop component.Fixes #33146