-
-
Notifications
You must be signed in to change notification settings - Fork 352
Description
Docs feedback
When clicking with a mouse on a button the button stays focused(tailwind focus: styles apply). So when pressing then Space or Enter the button receives click event and handles it.
The issue is that examples use :focus-visible pseudo and not :focus so user does not have visibility that button is currently focused and clicking Space or Enter would trigger some action. In cases when the button does some change or potential destructive action this can be a bad UX.
Suggested docs improvement
Change the examples in button docs to use :focus selector or prevent keyboard actions when button is focused via mouse and not a keyboard.
Example in MUI: https://mui.com/material-ui/react-button/#basic-button
When clicking with mouse and then press Space or Enter the MUI button is not activated(does not receive the click event)