You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this SLE PR switching from click events to change events for menu items, we noticed that the click event fires even if the menu is disabled. This appears to be misaligned with how native elements behave. We should visit each of our components and ensure they behave as expected.
Expected behavior
There is a very long discussion of expected behavior on this whatwg issue: whatwg/html#5886
My understanding of the summary is:
For form controls that are disabled:
if you click on non-disabled child elements, that content should receive the click event
regardless of whether you click on child content or the element itself, the element should not receive the click event
regardless of whether you click on child content or the element itself, parent elements should not receive the click event
And obviously any other documented side effects of clicking the component should not happen when it's disabled (e.g. menu items shouldn't fire change, links shouldn't navigate, etc). (Hopefully this works already)
Elements to audit and fix
I limit this to elements that have a click interaction. We might narrow the
Component
Audit Status
Implementation Status
Anchor
Anchor Button
Anchor Tabs
Banner
no click interaction / disabled state
Breadcrumb
Button
Card Button
Checkbox
Combobox (and list option)
Dialog
no click interaction / disabled state
Icons
no click interaction / disabled state
Menu / Menu Item / Menu Button
click event fires on the menu item when disabled
Number Field
Radio Group
Select (and list option)
Spinner
no click interaction / disabled state
Switch
Table
need to think through which parts of this the guidance would apply to
Tabs
Text Area
Text Field
Toggle Button
Toolbar
no click interaction / disabled state
Tree (and tree item)
The text was updated successfully, but these errors were encountered:
馃Ч Tech Debt
In this SLE PR switching from
click
events tochange
events for menu items, we noticed that theclick
event fires even if the menu is disabled. This appears to be misaligned with how native elements behave. We should visit each of our components and ensure they behave as expected.Expected behavior
There is a very long discussion of expected behavior on this whatwg issue: whatwg/html#5886
My understanding of the summary is:
For form controls that are disabled:
And obviously any other documented side effects of clicking the component should not happen when it's disabled (e.g. menu items shouldn't fire
change
, links shouldn't navigate, etc). (Hopefully this works already)Elements to audit and fix
I limit this to elements that have a click interaction. We might narrow the
click
event fires on the menu item when disabledThe text was updated successfully, but these errors were encountered: