-
Notifications
You must be signed in to change notification settings - Fork 4
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
Check Focus when exiting Keyboard Shortcuts Dialog #143
Comments
Thanks @terracoda, I think QA found this too, is this the same as #141? |
Hmm, #141 was for Edge, this is for Firefox. |
Focus management is correct for Chrome. |
Focus management is correct in firefox. Why does using a screen reader cause a problem here? |
Focus is lost when using Firefox and NVDA. |
#141 is fixed, but it didn't cover this issue. I am curious why this hasn't been a problem in previous releases. |
The implemenation of |
If I remove this line in AccessibleInstance: parentElement.hidden = !( visibilityCount === self.trailDiff.length ); the problem is still there, so it is likely caused by something else. |
Printing what Dialog is trying to restore focus to after closing, I see a reference to the help button, so focus may be lost after we are focusing the button. |
I am quite stumped. The bug is also not happening consistently, about 20% of the time, NVDA put focus on the help button. |
@jessegreenberg, it seems the management of focus is not always trivial. What are the tools/methods you use to manage focus? In the case of a pop-up dialog, focus in placed in the dialog (kept there until the dialog closes). Upon closing, how is focus managed at that point? |
I am using JavaScript to send focus back to the KeyboardHelpButton. #143 (comment) and the fact that this bug is not there when AT are not in use indicate that the JavaScript is sound. |
Very strange, that the focus management is affected by the AT being used. |
Ok... So I added this to KeyboardHelpDialog to try to figure out what is going on. click: function() {
console.log( 'click' );
debugger;
self.hide();
self.focusActiveElement();
} When NVDA is off, I see "click" in the console and hit the debugger. When I turn NVDA on, I no longer see "click" and I no longer hit the debugger?! Is this an aggressive caching issue? |
I don't know what it is, sorry. |
@zepumph helped me with this today, we got very inconsistent results while testing. While the dev tools were open, we didn't observe the bug. While the dev tools are closed, this is happening relatively consistently with NVDA. We discovered that the BarrierRectangle fire listener is somehow being called. We were able to catch the stack trace after closing the KeyboardHelpDialog with 'enter':
This led us to believe that perhaps NVDA is sending fake touch events the the browser. When we observe the bug with ?sceneryLog=Input, we see this. The "Barrier Rectangle input listener" output was logged at the same time of the bug in each case above. This line indicates where the bug occurs (but not the bug itself). |
@emily-phet said that this is not necessary to fix before the next RIAW RC. Proceeding with the cherry picking and QA process. |
The above commit fixes this problem by abstaining from blurring if the AT submitted a down event at the location of the PDOM outside of the display. VO was sometimes doing something similar in phetsims/balloons-and-static-electricity#401. I tested with JAWS in FF Quantum to verify. Closing. |
In an interview with a JAWS user, the focus after closing the Keyboard Shortcuts dialog seemed incorrect.
AT: JAWS, version 18 Professional
Browser: Firefox, version 52
User closed the dialog, and focus went back to the top of the sim or to the beginning of the Play Area, not sure which.
The expected behaviour would be to go to the Keyboard Shortcuts dialog button.
On re-testing with VO, I see if I read through part of the dialog and then hit escape, visual keyboard focus is lost and the virtual cursor seems to be at the beginning of Sim Resources region.
Could we make sure that upon closing the dialog with any method (ESC or Close button) that the visual focus is placed on the Keyboard Shortcuts button.
The text was updated successfully, but these errors were encountered: