-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Description
Feature Description
Support an input on whether activation is triggered on pointerdown or on click. Optionally, add support for a callback for developers to decide if a tab should be activated.
Use Case
Currently, it's impossible for developers to decide if a tab should be activated after a click event since tab activation always happens on pointerdown. One use case for this is for scrollable tabs. If the tab list is scrollable, attempting to scroll it will automatically activate the tab a user taps on.
With this feature, a developer could track if the tab list was scrolled since the last pointerdown event. If so, they can decide not to activate the tab on the click event. This type of interaction pattern is demonstrated by the accessibility guidelines for the Material Design Tabs component where tab activation doesn't occur when scrolling.
If adding something like a shouldActivate callback is too much, it's still valuable to support activation on click since that gives developers to option to prevent passing down the click event to the tab if they don't want it to be activated.
Similar to #32915