Keyboard navigation in meatball menu is inconsistent
Categories
(Firefox :: about:logins, defect, P3)
Tracking
()
People
(Reporter: tgiles, Assigned: gero, Mentored)
References
Details
(Keywords: good-first-bug, Whiteboard: [lang=js][good first bug])
Attachments
(3 files)
When using the keyboard to navigate this particular menu, both the right and left arrow keys cause the menu to focus the previous item in the list.
STR:
- Navigate to
about:logins
- Use keyboard to navigate to menu shown in
image.png
- Use right or left arrow key to navigate
- Notice that the previous item is selected
I'm not sure what the left/right arrow keys should do in this case. In my knowledge, the left/right arrow keys should effectively do nothing when navigating a menu like this, but I don't know if there are any Firefox quirks I'm not aware of
Reporter | ||
Updated•5 years ago
|
Reporter | ||
Updated•5 years ago
|
Reporter | ||
Comment 1•5 years ago
•
|
||
To help Mozilla out with this bug, here's the steps:
- Comment here on the bug that you want to volunteer to help. I (or someone else) will assign it to you.
- Download and build the Firefox source code
- If you have any problems, please ask on Element/Matrix in the
introduction
channel. They're there to help you get started. - You can also read the Developer Guide, which has answers to most development questions:
- If you have any problems, please ask on Element/Matrix in the
- Start working on this bug.
- You will need to modify the
_focusSuccessor
function inbrowser/components/aboutlogins/conent/components/menu-button.js
- Currently the function only checks if the down arrow is pressed, which causes the left/up/right arrow keys to behave as the same key
- In this menu situation, only the up and down arrow keys should perform navigation
- You will need to pass in the
event.key
into the_focusSuccessor
function and determine which key it is:- If it is the
ArrowUp
key, then setnext
to true - If it is the
ArrowDown
key, then setnext
to false - If it is any other key, return early from the function
- If it is the
- If you have any problems with this bug, please comment on this bug and set the needinfo flag for me. Also, you can find me and my teammates on the #lockwise-desktop channel on Element/Matrix most hours of most days.
- You will need to modify the
- Build your change with
mach build
and test your change withmach test browser/components/aboutlogins/tests/
. Also check your changes for adherence to our style guidelines by usingmach lint
- Submit the patch (including an automated test, if applicable) for review. Mark me as a reviewer so I'll get an email to come look at your code.
- After a series of reviews and changes to your patch, I'll mark it for checkin or push it to autoland. Your code will soon be shipping to Firefox users worldwide!
Hi,
I gladly give a patch, what you ask, but I recommend another solution, we can exclude ArrowLeft and Right at the entrypoint:
101 } else if (event.key.startsWith("Arrow")) {
102 event.preventDefault();
103 this._focusSuccessor(event.key == "ArrowDown"); <-- change to event.key == "ArrowDown" || event.key == "ArrowUp", we can save the early exit implementation and event.key pass
If it's done, i could also refactor the _focusSuccessor function a bit.
My suggestion is bad. We need to change signature or exit before call _focusSuccessor it key is not up or down.
Reporter | ||
Comment 4•5 years ago
|
||
Hi gero, it sounds like you have a good understanding of what the patch needs to do. I'm going to go ahead and assign you the bug.
Feel free to reach out if you have questions!
The tests are not a 100% solution - hard to assert nothing happened, but they catch the problem trivially.
Comment 8•5 years ago
|
||
bugherder |
Comment 9•5 years ago
|
||
I have verified this issue on the latest Nightly 86.0a1 build (Build ID: 20201218095607) on Windows 10 x64, macOS 10.15.6 and Linux Mint 20.
- Nothing happens if trying to navigate through the meatball menu using the left and right arrow keys.
- I have also verified that the navigation through the menu correctly works using the tab, up and down arrow keys.
- Also verified that the screen reader correctly reads the elements from the menu.
Updated•5 years ago
|
Description
•