[material-ui][Backdrop] Add aria-hidden by default#34691
[material-ui][Backdrop] Add aria-hidden by default#34691
Conversation
| const ModalBackdrop = styled(Backdrop, { | ||
| name: 'MuiModal', | ||
| slot: 'Backdrop', | ||
| 'aria-hidden': true, |
There was a problem hiding this comment.
| '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.
This should be updated to use the new suggested format now
mnajdova
left a comment
There was a problem hiding this comment.
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. |
|
Closing it for #47798 |
This PR aims to solve Issue 33146 In which having the
aria-hiddenvalue 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: truevalue to the Modal's custom Backdrop component.Fixes #33146