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
I would like to suggest that we create a lint rule that prevents using only onClick with ActionList.Item and that would auto-fix to use onSelect instead.
Context
I've recently fixed a number of accessibility bugs where behavior was only accessible with the mouse because we passed onClick to an action list item, instead of using the onSelect attribute.
While onClick is not completely invalid to put on ActionList.Item, if it is the only means by which an item can be activated, then it creates an inaccessible experience.
Using code search, I can also see some other code examples which might be problematic:
camchenry
changed the title
Create lint rule to prevent passing only onClick to ActionListItem
Create lint rule to prevent passing only onClick to ActionList.ItemAug 8, 2024
I would like to suggest that we create a lint rule that prevents using only
onClick
withActionList.Item
and that would auto-fix to useonSelect
instead.Context
I've recently fixed a number of accessibility bugs where behavior was only accessible with the mouse because we passed
onClick
to an action list item, instead of using theonSelect
attribute.Examples:
While
onClick
is not completely invalid to put onActionList.Item
, if it is the only means by which an item can be activated, then it creates an inaccessible experience.Using code search, I can also see some other code examples which might be problematic:
Examples
Code that should be considered invalid by this rule:
Code that should be considered valid by this rule:
The text was updated successfully, but these errors were encountered: