-
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
fix(radio): deselect button if value doesn't match up with the group anymore #14734
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Along the same lines as angular#14734. Deselects a selected list option, if its value is changed to something that doesn't match up with the group.
Along the same lines as #14734. Deselects a selected list option, if its value is changed to something that doesn't match up with the group.
Along the same lines as angular#14734. Deselects a selected list option, if its value is changed to something that doesn't match up with the group.
Along the same lines as #14734. Deselects a selected list option, if its value is changed to something that doesn't match up with the group.
…anymore Handles the case where a radio button is selected and then its value is changed to something that doesn't match up with the group anymore.
645e63d
to
5a29a88
Compare
This change depends on the order Angular sets the button's You can test it by comparing the group value between these two cases: <!-- No button will be selected since the checked setter was called first and it found that the group and buttons all have null values -->
<mat-radio-group>
<mat-radio-button checked value="1"> Option 1 </mat-radio-button>
<mat-radio-button value="2"> Option 2 </mat-radio-button>
<mat-radio-button value="3"> Option 3 </mat-radio-button>
</mat-radio-group>
<!-- The first button will be selected because checked will update the group based on the first button's value -->
<mat-radio-group>
<mat-radio-button value="1" checked> Option 1 </mat-radio-button>
<mat-radio-button value="2"> Option 2 </mat-radio-button>
<mat-radio-button value="3"> Option 3 </mat-radio-button>
</mat-radio-group> |
Handles the case where a radio button is selected and then its value is changed to something that doesn't match up with the group anymore.