-
-
Notifications
You must be signed in to change notification settings - Fork 630
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
NVDA announces a button with role="switch" and aria-checked="true" as "pressed checked" #9187
Comments
@iamrafan: Please list all browsers (including version) where this issue occurs. Thanks. |
Comfirmed with Firefox 64.0.2 and Chrome. Firefox just ignores the aria-checked attribute with regard to the pressed state, Chrome seems to add both the checked and pressed states when aria-checked is true. @jcsteh and @MarcoZehe: could one of you spread some light on this? It looks like there are two ways to implement toggle buttons, both which are considered valid implementation strategies according to the Mozilla Developer Network.
|
Ug. Yet another piece of ARIA spec silliness.
|
@DrSooom This specific issue occurs in both Chrome and Firefox
Do you want me to file separate issues for:
|
@iamrafan, thanks for your report. I think the issue is clear to us, especially thanks to the clarification by @jcsteh in #9187 (comment). It looks like the browser vendors do not yet agree and the ARIA spec is pretty messy in this. I would advice against using the switch role altogether and use the button role with aria-pressed instead. |
I honestly think trying to get the spec changed isn't worth the effort at this point. The simplest solution for now is to implement an overlay in NVDAObjects.IAccessible.ia2Web for xml-roles:switch, expose ROLE_CHECKBOX and remove STATE_PRESSED if present. |
@jcsteh wrote:
What do you think about the alternative: Replace STATE_CHECKED with STATE_PRESSED? I think I prefer this approach:
|
Your arguments are based on the premise that a switch is "supposed" to be a toggle button according to the spec. However, that is debatable. The spec says that a switch is "a type of checkbox". It doesn't say "a type of button". If you map it to checkbox, then speaking the negative checked state will "just happen" and is not hacky at all.
The fact that Edge treats it as a toggle button might be a convincing argument except that Edge will no longer be a real concern for much longer. :(
I don't really have a strong opinion on whether it should be a toggle button or a checkbox. My point is that I don't think you can convincingly use the spec to argue either way.
|
You're correct.
True. However, there is the UIA proxy for IA2, which I think will use the pressed state as expose by Chrome. I have to check that, though Re #9219: the switches in Skype 8 really look like toggle buttons visually. @michaelDCurran, may be you can cut the knot for us? |
@leonardder commented on 31 Jan 2019, 14:33 CET:
Nope, it looks like this is not yet complete. Both switches and buttons are treated as buttons, however there is currently no implementation for the relevant states. Tested with Windows build 18323 |
I just ran into this again with Riot. They're using the switch role and aria-checked, which in Firefox (and Chrome) sounds really messy. I am trying to change it to aria-pressed instead, but was pointed to various conflicting views on this, including this issue. Because the AAM says to map this to a toggle button, I am inclined to argue for aria-pressed, and maybe file spec bugs just for posterity. That, for Riot, is at least a fix that works and stops NVDA from saying stupid things like "not pressed checked". |
Steps to reproduce:
Actual behavior:
NVDA announces the toggle as "Improved dialog toggle button pressed checked"
Expected behavior:
The toggle is expected to be announced as "Improved dialog toggle button checked" or " Improved dialog toggle button pressed"
System configuration
NVDA installed
NVDA version: 2018.4
Windows version: Windows 10 Enterprise 1803
Does the issue still occur after restarting your PC? Yes
Have you tried any other versions of NVDA? Yes
The text was updated successfully, but these errors were encountered: