Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Browse mode cursor placed incorrectly despite focus when leaving dialog which hides outside content #3145
Reported by detlev on 2013-04-10 07:47
a link with role button ("Display a dialog") displays a custom dialog (a hidden div at the start of the page source code).
The page background (the rest of the page) is hidden by setting the dive that encloses it to aria-hidden=true. (This happend to improve focus handling in iOS/VoiceOver).
Closing the dialog sets aria-hidden to false and then restores the focus. This however is not understood by NVDA - the focus moves insteasd to the start of the page. The example works fine in OSX / VoiceOver and JAWS.
Apparently, there is a delay in NVDA when setting aria-hidden=false since the resoration of focus in the next line of script fails (possibly because NVDA does not 'see' the background which contains the button that should be focused on closing the dialog).
Comment 2 by hhillen on 2013-10-10 16:01
The problem does not seem to be related to timing though. You can move focus into a role="dialog" container, set aria-hidden="true" on the main contents of the page, then set aria-hidden="false" again, wait ten seconds, move focus back to the button that triggered the dialog, and the problem will still occur.
The issue only happens when focus is moved from within a role="dialog" container to an element inside a container that previously had aria-hidden="true".
I've attached a test case that simplifies the problem. To use this test case to the following:
Note that taking out the disabling off the button from this scenario will have no effect on this issue. Neither does completely removing the aria-hidden attribute (as opposed to just setting it to "false"), or any timeouts you can think of.
Together with the fact that NVDA re-announces the document title whenever focus is moved out of a dialog (i'm not sure if this is a bug or a feature, but it's very annoying and not helpful) and the fact that NVDA will disable browse mode inside dialogs (which I understand is conforming the ARIA spec, but simply doesn't work for a lot of real life dialog use cases that happen to have a lot of static content), this issue makes the dialog role a very hard sell when trying to support NVDA. It would be great if this could be fixed.
Another demo showing this issue with a basic dialog can be found here: https://dl.dropboxusercontent.com/u/3075595/cgi/CGIFix/docdialog.html . Note that in this demo the dialog contents have been wrapped in a role="document" role to allow browse mode (which I know is wrong and a hack).
Comment 4 by jteh on 2013-10-14 06:45
Comment 5 by James Teh <jamie@... on 2013-10-15 00:17