nvaccess / nvda

NVDA, the free and open source Screen Reader for Microsoft Windows
https://www.nvaccess.org/
Other
2.11k stars 637 forks source link

Bug with buttons inside headings with accessible names #13296

Open scottaohara opened 2 years ago

scottaohara commented 2 years ago

Ran into this issue when encountering a button inside of a div role=heading with an aria-label specified on the heading.... which was unnecessary... but technically it is valid per the ARIA specification. In this instance, the button was not consistently discoverable when navigating the page with scan mode, and activating the button was not possible unless I switched to application mode.

Narrator and JAWS did not experience this issue when testing.

All tests were performed with latest Edge, Chrome and Firefox.

Steps to reproduce:

Go to the following test page: https://codepen.io/scottohara/full/jOaqMKq Attempt to activate the "test case" button while NVDA is in scan mode.

Actual behavior:

Cannot activate the 'test case' button in scan mode. There are additional issues with attempting to find the button when navigating with scan mode or using the b key to navigate by buttons.

Expected behavior:

Should be able to activate and find the button without issue.

System configuration

NVDA installed/portable/running from source:

NVDA version:

2021.3 and 2021.3.1

Windows version:

10

Other questions

Does the issue still occur after restarting your computer?

yes

Have you tried any other versions of NVDA? If so, please report their behaviors.

noted above

If NVDA add-ons are disabled, is your problem still occurring?

n/a

Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?

n/a

feerrenrut commented 2 years ago

I haven't investigated this yet, but a note that may be relevant: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/heading_role#accessibility_concerns

Warning: Using aria-label or aria-labelledby will hide the content of your heading from assistive technologies, reading the label instead of the heading.

scottaohara commented 2 years ago

Yeah. Here be a reason why that warning was written then I guess.

Please note, I’m not saying I agree with this pattern. I never much understood or agreed with naming a heading in this way, rather than by its contents. But this is conforming to what the aria spec says is allowed. For better or worse.