Skip to content
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

Modal dialogue with multiple buttons - focus moves to last button read #12594

Closed
jboehr opened this issue Jun 29, 2021 · 2 comments
Closed

Modal dialogue with multiple buttons - focus moves to last button read #12594

jboehr opened this issue Jun 29, 2021 · 2 comments

Comments

@jboehr
Copy link

jboehr commented Jun 29, 2021

Steps to reproduce:

Here is an example in JSFiddle: https://jsfiddle.net/m3tfjq1c/7/
Also, here is the general setup:
A modal dialog (a container with role="dialog" and aria-modal="true")
In the modal dialogue you have two button elements of type button
Those buttons must be inside a div with style "display: flex".
Per accessibility guidelines, put focus on the first button element when the dialog is shown.

Actual behavior:

The focused button is read first, followed by the second button. If you hit enter after the second button is read, the event tied to the second button is triggered, rather than the event tied to the first button. You also see the visual of the focus bolding around the element quickly move from the currently focused button to the second button.

Expected behavior:

The event tied to the currently focused button (the first button) is triggered when hitting the enter key.

System configuration

NVDA installed/portable/running from source: NVDA Installed

NVDA version: 2020.4

Windows version: Windows 10

Name and version of other software in use when reproducing the issue: Chrome 91.0.4472.101, Firefox 77.0.1

Other information about your system: N/A

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. No

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

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

@boompsy
Copy link

boompsy commented Jul 30, 2021

Hi @jboehr, turns out this is related to / a duplicate of #8971, and in particular this reply was very helpful in identifying the actual behavior.

When a role="dialog" element is triggered, NVDA treats it as a new 'page' in relation to the 'Automatic Say All on page load' setting (Settings > Browse Mode). When a webpage first loads, NVDA announces all the content on the page, including links and buttons. If you happen to hit enter on a link / button during that time, that item will be activated. This is easier to notice if the label caption is long or if you slow down the speaking rate.

Hope that helps!

@Adriani90
Copy link
Collaborator

Closing this as duplicate of #8971

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants