Implement an official variant for the "More options" icon button pattern
Categories
(Toolkit :: UI Widgets, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox142 | --- | fixed |
People
(Reporter: jules, Assigned: akulyk)
References
(Blocks 1 open bug)
Details
(Whiteboard: [fidefe-reusable-components])
Attachments
(1 file)
We use the 'More options'/'...' icon button that opens up a Panel Menu throughout different features (Add-ons, New Tab, Logins, Address bar); this is a pattern we can capture as an official variant for the button component.
Additionally, a11y has brought up the need for documenting and standardizing best practices behind using this design pattern, such as considering proper attributes as well as documenting best practices that explain we should avoid showing 'more options' only on hover (we're doing this in New Tab and the Address bar today, for example).
Let's consider implementing this as an official variant for the button component, as well as including any additional a11y considerations / documentation within Storybook / Acorn docs.
Comment 1•2 years ago
|
||
Thank you for capturing it, Jules!
Ideally, the ...
button would follow a menu button pattern with the following WAI-ARIA properties, so assistive technologies and their users are aware of the expected functionality and operation of this control:
- The element that opens the menu is
<button>
(or, at the very minimum, hasrole="button"
). - The button has
aria-haspopup
attribute set to eithermenu
ortrue
. - When the menu is displayed, the button has
aria-expanded
attribute that is set totrue
. When the menu is hidden,aria-expanded
is set tofalse
. - The element that contains the menu items (that is displayed by activating the button) has
role="menu"
. - (Optional) The button has a value specified for
aria-controls
that refers to the element withrole="menu"
. This would ensure assistive technology knows which specific element is being controlled by the button.
Also, the button should provide the following keyboard interaction (when a keyboard focus is on the button):
Enter
: opens the menu and places focus on the first menu item.Space
: Opens the menu and places focus on the first menu item.- (Optional)
Down Arrow
: opens the menu and moves focus to the first menu item. - (Optional)
Up Arrow
: opens the menu and moves focus to the last menu item.
Reporter | ||
Updated•2 years ago
|
Updated•2 years ago
|
Comment 2•1 year ago
|
||
Likely the bug 1911161 would need to be resolved for this (if moz-button
is extended) or taken into an account for this development too.
Comment 3•11 months ago
|
||
this was brought up in bug 1924107 review https://phabricator.services.mozilla.com/D226010 where earlier comments here basically covered the desires. maybe only other potential thing is having a default / shared tooltip string for "Open menu"
Comment 6•2 months ago
|
||
bugherder |
Updated•1 month ago
|
Description
•