feat(MatSelect): Active state should take into account keyboard versus mouse interaction #23953
Labels
area: material/select
feature
This issue represents a new feature or feature request rather than a bug or bug fix
P4
A relatively minor issue that is not relevant to core functions
Feature Description
Hello,
We would like to fully implement accessibility in terms of good color contrast and visible focus states (WCAG Focus Visible).
What we use right now to achieve this is the ":focus-visible" selector. We also use FocusMonitor from the A11yModule of CDK to create accessible keyboard interaction. FocusMonitor has a neat feature - it adds classes specific to the interaction type that the user uses (e.g. on keyboard interaction, the currently focused item has the ".cdk-keyboard-focus" class).
What I'd suggest as an improvement to the Select component is to have this difference illustrated in the component, out of the box. At the moment we are styling the ".mat-active" class in order to have a visible focus state for keyboard users but this looks very odd for mouse users.
Use Case
Currently, the Select component looks exactly the same for both mouse and keyboard interaction.
Stackblitz link with current behavior: https://stackblitz.com/edit/angular-7779kz?file=src%2Fapp%2Fselect-overview-example.html
What we would like to see in the future is the following:
Keyboard interaction with visible outline:
Mouse interaction:
The text was updated successfully, but these errors were encountered: