-
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(material/select): add opt-in input that allows selection of nullable options #30142
Conversation
src/material/select/select.md
Outdated
@@ -66,6 +66,15 @@ If you want one of your options to reset the select's value, you can omit specif | |||
|
|||
<!-- example(select-reset) --> | |||
|
|||
### Allowing nullable options to be selected | |||
|
|||
By default any options with a `null` or `undefined` value will reset the select's value. This is |
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.
I'd probably remove the statement about mimicing native behavior, since I don't think that's the actual case anymore. It's enough to include the first sentence to basically say "this is how we handle null by default"
…ble options By default `mat-select` treats options with nullable values as "reset options", meaning that they can't be selected, but rather they clear the select's value. This behavior is based on how the native `select` works, however in some cases it's not desirable. These changes add an input that users can use to opt out of the default behavior. Fixes angular#25120.
d489620
to
23d28b5
Compare
…ble options (#30142) By default `mat-select` treats options with nullable values as "reset options", meaning that they can't be selected, but rather they clear the select's value. This behavior is based on how the native `select` works, however in some cases it's not desirable. These changes add an input that users can use to opt out of the default behavior. Fixes #25120. (cherry picked from commit 0296713)
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. |
By default
mat-select
treats options with nullable values as "reset options", meaning that they can't be selected, but rather they clear the select's value. This behavior is based on how the nativeselect
works, however in some cases it's not desirable. These changes add an input that users can use to opt out of the default behavior.Fixes #25120.