-
-
Notifications
You must be signed in to change notification settings - Fork 302
Closed
Labels
accessibilitya11ya11ybreaking changeIntroduces changes that are not backward compatible.Introduces changes that are not backward compatible.component: tabsChanges related to the tabs component.Changes related to the tabs component.
Milestone
Description
Feature request
Summary
Current behaviour for tabs is to activate as soon as the pointer is pressed. In order to meet WCAG Level A 2.2 this should instead be changed to meet one of the following:
- No Down-Event
a. The down-event of the pointer is not used to execute any part of the function; - Abort or Undo
a. Completion of the function is on the up-event, and a mechanism is available to abort the function before completion or to undo the function after completion; - Up Reversal
a. The up-event reverses any outcome of the preceding down-event; - Essential
a. Completing the function on the down-event is essential.
My recommendation is to go for 1. as other examples do.
Examples in other libraries
- Material UI's implementation of tabs already follows this.
- Radix Primitives [Tabs] Tab activates onMouseDown, breaking WCAG 2.5.2: Pointer-cancellation radix-ui/primitives#1879
- React Aria makes it configurable useTab: adds support for shouldSelectOnPressUp adobe/react-spectrum#4342
Additionally, WCAG provides an example implementation. Observe that in this implementation the only pointer event listened for is onClick, which only fires when the pointer is released.
Motivation
Changing this improves consistency with other components that meet accessibility standards and allows users to recover from accidental clicks.
mj12albert
Metadata
Metadata
Assignees
Labels
accessibilitya11ya11ybreaking changeIntroduces changes that are not backward compatible.Introduces changes that are not backward compatible.component: tabsChanges related to the tabs component.Changes related to the tabs component.
Projects
Status
Recently completed