md-button that reveals dialog continues to display focus styled when returned
It seems like the originating button intermittently gets the gray background when returning from a dialog. https://codepen.io/anon/pen/qORpvo
In the demo it is happening only sometimes, but in another project, it's showing every time.
Focus should be kept, but it should be visually suppressed because it is a mouse event and doesn't require immediate keyboard affordance.
Expected:
- No focus highlight remains after clicking
- Press Tab a few times with visible focus
- Then click anywhere and watch it visible focus disappear
Can confirm, occurs only when clicking on a button that closes the dialog or pressing ESC, when clicking outside the button losses his focus
Focus is being sent back to the triggering button on purpose–so that a keyboard or screen reader user will be directed to the correct content. This is the intended behavior.
So @marcysutton this is not a bug and can be closed?
Sounds like it! I will close.
On Mac OS X, clicking on push buttons or checkboxes does not steal focus from other controls. They can still be focused via the keyboard, so there's no accessibility issue.
http://sendvid.com/2gweiimg
In my humble opinion, the same is desirable on the web. This can be achieved on push buttons via event.preventDefault() on mousedown.
Unfortunately we do not have the same primitives on the Web as native platforms do. If you're curious about the limitations surrounding this issue, read up on CSS Input Modality. I think Angular Material will have to implement something similar to @alice and @bkardell's prollyfill since the perceived "bug" will just keep coming up again and again and again.