-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug(material/radio): Focus styling remains applied after mouseup #25090
Comments
Seems like the focus styling being persistent starts in v11 since it doesn't happen on the docs site for v10: https://v10.material.angular.io/components/radio/examples. |
Related issue that'll be resolved when this one is (with some small changes in the checkbox): #18912. |
Thank you very much for pointing to the related issue.
|
In most cases focus moves during the `mousedown` event so all of our detection uses `mousedown` events to track it. It breaks down for the common use case where a `label` is connected to an `input`, because there focus moves on the `click` event instead. This has been a long-standing issue with the `FocusMonitor` that has caused problems with `mat-checkbox`, `mat-radio-button` and `mat-slide-toggle`. These changes add special handling for the `input` + `label` case that checks if the previous mouse interaction was with a label belonging to the current `input` receiving focus. Fixes angular#25090.
In most cases focus moves during the `mousedown` event so all of our detection uses `mousedown` events to track it. It breaks down for the common use case where a `label` is connected to an `input`, because there focus moves on the `click` event instead. This has been a long-standing issue with the `FocusMonitor` that has caused problems with `mat-checkbox`, `mat-radio-button` and `mat-slide-toggle`. These changes add special handling for the `input` + `label` case that checks if the previous mouse interaction was with a label belonging to the current `input` receiving focus. Fixes #25090.
In most cases focus moves during the `mousedown` event so all of our detection uses `mousedown` events to track it. It breaks down for the common use case where a `label` is connected to an `input`, because there focus moves on the `click` event instead. This has been a long-standing issue with the `FocusMonitor` that has caused problems with `mat-checkbox`, `mat-radio-button` and `mat-slide-toggle`. These changes add special handling for the `input` + `label` case that checks if the previous mouse interaction was with a label belonging to the current `input` receiving focus. Fixes #25090. (cherry picked from commit 089eb6f)
In most cases focus moves during the `mousedown` event so all of our detection uses `mousedown` events to track it. It breaks down for the common use case where a `label` is connected to an `input`, because there focus moves on the `click` event instead. This has been a long-standing issue with the `FocusMonitor` that has caused problems with `mat-checkbox`, `mat-radio-button` and `mat-slide-toggle`. These changes add special handling for the `input` + `label` case that checks if the previous mouse interaction was with a label belonging to the current `input` receiving focus. Fixes #25090. (cherry picked from commit 089eb6f)
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Is this a regression?
The previous version in which this bug was not present was
No response
Description
sadly, the material radiobutton stays focused after being selected.
This could be intended by the material specs - #14290
But other material components like checkbox or inputs does not have this behavior.
The material specs ( https://material.io/components/selection-controls#radio-buttons ) mention a "Pressed Focus" state - but the animation does show a different behavior after click: https://kstatic.googleusercontent.com/files/bed79fcf6804cded983c22cde6ee42734fce03e47589c4f3d4338405c67cd0b7e28a30c4fbcf9eea0403fb2e8846c4264d432451a31eb7bd364e94d30b1e77d2
perhaps the behavior to keep a "pressed focused" state or to remove focus (and defocus just like all other elements/checkboxes) could be made optional.
Reproduction
Steps to reproduce:
head to https://material.angular.io/components/radio/examples and click a radio button
Expected Behavior
the focus / animation / big transparent ripple circle should disappear
Actual Behavior
the focus / animation / big transparent ripple circle does not disappear
Environment
The text was updated successfully, but these errors were encountered: