<Button autoFocus>text</Button> should show the ripple on the button just as tabbing to it does
Initial render of <Button autoFocus>text</Button> will behave correct (if you press enter, the button is pressed) but it doesn't visually show it
code: https://codesandbox.io/s/jjvymvoo4w
demo: https://jjvymvoo4w.codesandbox.io/ (just press enter, try to tab around)
| Tech | Version |
|--------------|---------|
| Material-UI | v1.3.1 |
| React | v16.3.2 |
@albinekb I have seen this type of question a lot of time. The focus ripple is only here to help people using the keyboard. You will see the focus ripple if the focus is concurrent to a user keyboard interaction.
Use the focusVisible action if you really need to see the ripple, but I would encourage you to challenge this requirement with your product team. For instance, you can follow this thread #9659.
Awesome. Thanks for clarifying. That makes sense. This is for an internal tool where i have "Approve" and "Reject" buttons, where I want the "Approve" button to be in focus when you go to the page, so you can see that you just need to hit enter to approve the thing. focusVisible is perfect for this. Again sorry for opening this issue, now I know 馃檹
Most helpful comment
@albinekb I have seen this type of question a lot of time. The focus ripple is only here to help people using the keyboard. You will see the focus ripple if the focus is concurrent to a user keyboard interaction.
Use the
focusVisibleaction if you really need to see the ripple, but I would encourage you to challenge this requirement with your product team. For instance, you can follow this thread #9659.