-
Notifications
You must be signed in to change notification settings - Fork 213
Description
Some of us working on the menu elements proposal recently learned that the APG recommends soft disabling menuitem elements when they have the disabled
. My understanding of soft disabling is that it essentially makes disabled=true
elements non-interactive/activatable, while still keyboard reachable and focusable (maybe these last two are the same?).
Given this, we should probably specify that this soft-disabled behavior applies to <menuitem disabled>
elements, as opposed to the default "hard disabled" behavior that applies to things like <button disabled>
(making them unfocusable, unclickable, and keyboard unreachable). Here are some follow-up questions regarding the exact behavior of soft disabling:
-
Should
:hover
styles apply?- My recommendation: Yes. Hover styles still apply to hard disabled elements (e.g.,
<button disabled>
), so we should not deviate
- My recommendation: Yes. Hover styles still apply to hard disabled elements (e.g.,
-
Should hover focus/activate a disabled menuitem?
- The APG allows for focus and activation to follow hover for menuitems (see https://www.w3.org/WAI/ARIA/apg/patterns/menubar/examples/menubar-editor/#:~:text=In%20general%2C%20moving,focus%20follows%20hover); basically, if the user activates a
<menuitem>
in a<menubar>
(for example, by clicking it), and proceeds to hover over a sibling<menuitem>
, focus and activation will move to the new<menuitem>
- What happens if the user proceeds to hover over a
<menuitem disabled>
sibling? Should focus follow? Should activation follow? - My recommendation is that focus/hover should follow, but the
<menuitem disabled>
should not be activated, i.e., it will not invoke its corresponding sub-<menulist>
popover
- The APG allows for focus and activation to follow hover for menuitems (see https://www.w3.org/WAI/ARIA/apg/patterns/menubar/examples/menubar-editor/#:~:text=In%20general%2C%20moving,focus%20follows%20hover); basically, if the user activates a
-
Should we focus
<menuitem disabled>
elements on click?- When you click a hard disabled element, the platform neither fires a
click
event at the element, nor focuses it - If we want to
<menuitem disabled>
to be focusable at the very least by keyboard navigation, should we let clicking draw in focus too? Should that fireclick
events? (Probably not) - My recommendation: clicking/tapping the
<menuitem disabled>
element will focus it, but not activate it. Firingclick
or other activation events could confuse developer JS. Thefocus
event will still fire
- When you click a hard disabled element, the platform neither fires a
In short, it seems that a <menuitem disabled>
should never be able to be activated, although focus and hover should generally behave as if it were. This seems like the best tradeoff for users of accessibility technology, but I'm new to this whole "soft disabling" concept, so please tell me where I'm wrong.