aria-hidden=true gets applied on top level container when a modal is opened. But if disablePortal is used, aria-hidden should not be set on that top level container as the modal will be created inline and most likely within that top level container
Running axe on the opened modal yields the following error:
"ARIA hidden element must not contain focusable elements (aria-hidden-focus)"
Fix all of the following:
Focusable content should have tabindex='-1' or be removed from the DOM
You can find more information on this issue here:
https://dequeuniversity.com/rules/axe/3.3/aria-hidden-focus?application=axeAPI
https://www.w3.org/TR/wai-aria-practices/examples/dialog-modal/dialog.html
The dialog element is not a descendant of any element that has aria-hidden set to true.
Current Behavior 😯
- Modal with
disablePortal prop is opened and aria-hidden is set to true on top level html node
Expected Behavior 🤔
- Modal with
disablePortal prop is opened and aria-hidden is not set to true on top level html node
- Modal without
disablePortal prop is opened and aria-hidden is set to true on top level html node
Steps to Reproduce 🕹
https://codesandbox.io/s/material-mui-demo-9oddt?fontsize=14&hidenavigation=1&theme=dark
Context 🔦
Your Environment 🌎
| Tech |
Version |
| Material-UI |
v4.9.0 |
| React |
v16.12.0 |
| Browser |
|
| TypeScript |
v3.8.0-dev.20200125 |
| etc. |
|
aria-hidden=truegets applied on top level container when a modal is opened. But ifdisablePortalis used,aria-hiddenshould not be set on that top level container as the modal will be created inline and most likely within that top level containerRunning axe on the opened modal yields the following error:
You can find more information on this issue here:
https://dequeuniversity.com/rules/axe/3.3/aria-hidden-focus?application=axeAPI
https://www.w3.org/TR/wai-aria-practices/examples/dialog-modal/dialog.html
Current Behavior 😯
disablePortalprop is opened andaria-hiddenis set to true on top level html nodeExpected Behavior 🤔
disablePortalprop is opened andaria-hiddenis not set to true on top level html nodedisablePortalprop is opened andaria-hiddenis set to true on top level html nodeSteps to Reproduce 🕹
https://codesandbox.io/s/material-mui-demo-9oddt?fontsize=14&hidenavigation=1&theme=dark
Context 🔦
Your Environment 🌎