Activating disclosures in the dev console with NVDA forcefully redirects focus to the console input
Categories
(DevTools :: Console, defect, P3)
Tracking
(firefox69 fixed)
Tracking | Status | |
---|---|---|
firefox69 | --- | fixed |
People
(Reporter: dickson.tan.2013, Assigned: dickson.tan.2013)
Details
(Keywords: access)
Attachments
(1 file)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0
Steps to reproduce:
CC: @jcsteh
With NVDA running:
- Paste the following code into the console.
console.groupCollapsed("test");
console.log("some content");
console.groupEnd();
- Press space on the collapsed button to expand its contents, while still in browse mode.
Actual results:
Focus is always forcefully moved to the text input. The disclosure does expand.
Expected results:
The disclosure is expanded, and focus does not move unexpectedly.
Updated•6 years ago
|
Updated•6 years ago
|
Assignee | ||
Comment 1•6 years ago
|
||
I'd like to take a stab at solving this. I've found the CollapsedButton component, and the actions and reducers triggered when the disclosure is toggled, but haven't yet found what is responsible for redirecting focus back to console input.
Comment 2•6 years ago
|
||
Hey Dickson.
My guess is that it's the onClick
event in devtools/client/webconsole/components/App.js#82-132 that put back the focus on the input.
Assignee | ||
Comment 3•6 years ago
|
||
Thanks Nicolas.
Jamey investigated this when I filed this issue in the NVDA repository, and his guess is that this is intended behaviour, since otherwise mouse users who click on disclosures will have focus forced from text input to the button.
Note that this does work if the screen reader is in focus mode, but is an extra step.
Will try to think of a situation to differentiate these 2 scenarios, or maybe only conditionally restore focus if it was already on input.
Comment 4•6 years ago
|
||
(In reply to Dickson Tan from comment #3)
Jamey investigated this when I filed this issue in the NVDA repository, and his guess is that this is intended behaviour, since otherwise mouse users who click on disclosures will have focus forced from text input to the button.
I haven't looked at the code. However, assuming I'm correct about this (and assuming we don't need the mousedown or drag events for any other reason), you could:
- Get rid of the focus behaviour in the click event.
- Call event.preventDefault() in the mousedown event. This will prevent the default focus behaviour when the mouse is clicked, thus preventing the focus annoyance for mouse users in the first place.
Assignee | ||
Comment 5•6 years ago
|
||
Thanks Jamie, that solution worked wonderfully:
- using event.preventDefault in the disclosure's onmousedown event. Btw, I can't seem to find documentation anywhere on MDN about the mousedown event causing elements to gain focus, so am wondering where that is documented. Also, if NVDA is in browse mode and I hit space on a button, does it simulate an onmousedown?
- Preventing the onclick from bubbling up to the parent app.js component, which redirects focus when it receives an onclick.
This behaviour will occur on other components in the output area as well, but I haven't ran into other examples like this where it is problematic.
I'm also trying to open an MR, but am not sure how to go about doing so. Do I need to create a new branch for the feature like in git?
Assignee | ||
Comment 6•6 years ago
|
||
Some other misc questions:
- When fixing this, I had to close firefox, and run
mach build
, then restart firefox again to see my changes, which is a really long feedback cycle. Is there a way of running it with live reload support? - Is there a way of printing out stuff to the console from a component in dev tools as a debugging aid? Console.log doesn't seem to work at all.
Thanks a lot for the guidance :)
Comment 7•6 years ago
|
||
(In reply to Dickson Tan from comment #5)
Also, if NVDA is in browse mode and I hit space on a button, does it simulate an onmousedown?
It simulates a click, which gets mapped to mousedown, click and mouseup events in the browser.
I'm also trying to open an MR, but am not sure how to go about doing so. Do I need to create a new branch for the feature like in git?
This needs to be submitted to mozilla-central, so you'll need to use Phabricator. See https://moz-conduit.readthedocs.io/en/latest/phabricator-user.html
(In reply to Dickson Tan from comment #6)
- When fixing this, I had to close firefox, and run
mach build
, then restart firefox again to see my changes, which is a really long feedback cycle. Is there a way of running it with live reload support?
I don't think you can live reload. However, because you're not modifying any binary code, you can do:
mach build faster
which will just rebuild the non-binary stuff (js, xul, html, etc.). That is much faster. You still need to restart Firefox, though.
- Is there a way of printing out stuff to the console from a component in dev tools as a debugging aid? Console.log doesn't seem to work at all.
It might get logged to the browser console (control+shift+j)? I'm not sure, but others here might know.
Updated•6 years ago
|
Assignee | ||
Comment 8•6 years ago
|
||
The top-level App component forcefully resets focus to the console input when something in the output gains focus, e.g disclosure toggles, and the clear output button.While this is useful for mouse users when typing, it breaks reading flow for screen reader users when reviewing output, being sent back to input when interacting with disclosures.
This commit prevents the unwanted focus behaviour when clicking by suppressing it in an onMouseDown, and prevents the click event from bubbling to the App component so focus doesn't get reset.
Assignee | ||
Comment 9•6 years ago
|
||
I've just submitted a patch to phabricator, let me know if I missed out any steps.
Updated•5 years ago
|
Comment 10•5 years ago
|
||
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1127060b0433 fix clicking on disclosures in the console redirecting focus to input. r=nchevobbe
Comment 11•5 years ago
|
||
bugherder |
Updated•5 years ago
|
Description
•