Open gayane-1 opened 3 months ago
In React-Aria, we use the [data-live-announcer]
or [data-react-aria-top-layer]
attribute to identify elements that should not be hidden from the accessibility tree when ariaHideOutside
executes.
I was able to fix the CodeSandbox example you shared by adding the following to the useLayoutEffect
callback method within MonacoEditorReact
at line 89:
const ariaContainer = document.querySelector(".monaco-aria-container");
if (ariaContainer) {
ariaContainer.dataset.liveAnnouncer = true;
}
@majornista First, thanks for the workaround.
We should discuss possible API's to make this easier. I'm still worried that there may be other cases where this isn't as easy. I think it'd be good to be able to register other live announcer regions for the ariaHideOutside to avoid/omit.
Provide a general summary of the issue here
We are currently using the Monaco Editor in a Spectrum Dialog and have encountered an accessibility issue. When using the tab toggle functionality (pressing ctrl+m (Windows) or ctrl+shift+m(Mac)) to switch between spaces and the next focusable element, the screen reader does not provide alerts about that when the Editor is inside a DialogContainer. However, it works correctly outside of the DialogContainer.
๐ค Expected Behavior?
Screen readers should alert users like this: "Pressing tab will now insert a tab character/focus on the next focusable element."
๐ฏ Current Behavior
The screen reader does not provide alerts about that when the Editor is inside a DialogContainer.
๐ Possible Solution
In our case
monaco-aria-container
beingaria-hidden
when the dialog opens is the cause.๐ฆ Context
No response
๐ฅ๏ธ Steps to Reproduce
Problem: When inside the editor area, pressing ctrl+m (Windows) or ctrl+shift+m(Mac) changes the tab functionality to either insert spaces or move to the next focusable element. Screen readers should alert users by saying something like this: "Pressing tab will now insert a tab character/focus on the next focusable element.", however this alert is not occurring when the editor (in code: Calculation component) is inside the dialog.
Please check out App.tsx and the comments. There is:
Feel free to switch between those and test accordingly.
Note:
Draft prototype in CodeSandbox
Version
3.30.0
What browsers are you seeing the problem on?
Chrome
If other, please specify.
No response
What operating system are you using?
MacOS
๐งข Your Company/Team
No response
๐ท Tracking Issue
No response