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
Selecting reset option in mat-select #10675
Comments
…on is selected twice in a row Fixes the select's change events being fired when a reset option is selected twice in a row. Fixes angular#10675.
…on is selected twice in a row Fixes the select's change events being fired when a reset option is selected twice in a row. Fixes #10675.
…on is selected twice in a row Fixes the select's change events being fired when a reset option is selected twice in a row. Fixes #10675.
…on is selected twice in a row Fixes the select's change events being fired when a reset option is selected twice in a row. Fixes angular#10675.
…on is selected twice in a row Fixes the select's change events being fired when a reset option is selected twice in a row. Fixes angular#10675.
…on is selected twice in a row Fixes the select's change events being fired when a reset option is selected twice in a row. Fixes #10675.
…on is selected twice in a row Fixes the select's change events being fired when a reset option is selected twice in a row. Fixes angular#10675.
…on is selected twice in a row Fixes the select's change events being fired when a reset option is selected twice in a row. Fixes #10675.
…on is selected twice in a row Fixes the select's change events being fired when a reset option is selected twice in a row. Fixes #10675.
Fixes `mat-select` emitting its change event twice when a reset value is selected, as well as when it's selected twice in a row. This PR covers angular#10859 which would've introduced another issue. Fixes angular#10675. Fixes angular#13579.
Fixes `mat-select` emitting its change event twice when a reset value is selected, as well as when it's selected twice in a row. This PR covers angular#10859 which would've introduced another issue. Fixes angular#10675. Fixes angular#13579.
What's the status on this issue? Any chance it will be merged anytime soon? |
Fixes `mat-select` emitting its change event twice when a reset value is selected, as well as when it's selected twice in a row. This PR covers angular#10859 which would've introduced another issue. Fixes angular#10675. Fixes angular#13579.
Fixes `mat-select` emitting its change event twice when a reset value is selected, as well as when it's selected twice in a row. This PR covers angular#10859 which would've introduced another issue. Fixes angular#10675. Fixes angular#13579.
Any update as I'm facing this issue as well. |
I am struggling with the same issue right now. |
Does anyone have a workaround for this issue until we have an official fix? |
I solved this issue with additional checking |
Fixes `mat-select` emitting its change event twice when a reset value is selected, as well as when it's selected twice in a row. This PR covers angular#10859 which would've introduced another issue. Fixes angular#10675. Fixes angular#13579.
Thanks! I used this flag to bypass this problem:
Template
TS
|
Is there any thing new with this issue? Every other work around isn't really a solution. |
Fixes `mat-select` emitting its change event twice when a reset value is selected, as well as when it's selected twice in a row. This PR covers angular#10859 which would've introduced another issue. Fixes angular#10675. Fixes angular#13579.
Is there any thing new with this issue? x2 |
I develop this work around (I'm was working with forms too so...), setting the value to undefined to reset the mat-select. HTML
TS
|
Fixes `mat-select` emitting its change event twice when a reset value is selected, as well as when it's selected twice in a row. This PR covers angular#10859 which would've introduced another issue. Fixes angular#10675. Fixes angular#13579.
Fixes `mat-select` emitting its change event twice when a reset value is selected, as well as when it's selected twice in a row. This PR covers angular#10859 which would've introduced another issue. Fixes angular#10675. Fixes angular#13579.
Fixes `mat-select` emitting its change event twice when a reset value is selected, as well as when it's selected twice in a row. This PR covers angular#10859 which would've introduced another issue. Fixes angular#10675. Fixes angular#13579.
Fixes `mat-select` emitting its change event twice when a reset value is selected, as well as when it's selected twice in a row. This PR covers angular#10859 which would've introduced another issue. Fixes angular#10675. Fixes angular#13579.
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. |
) Fixes `mat-select` emitting its change event twice when a reset value is selected, as well as when it's selected twice in a row. This PR covers angular#10859 which would've introduced another issue. Fixes angular#10675. Fixes angular#13579.
Bug, feature request, or proposal:
When undefined (reset) option is selected in
mat-select
, and you open the options list and select the undefined option again, bothvalueChange
andngModelChange
events are fired. When you do the same with non-undefined option, none of the events is fired.What is the expected behavior?
I would expect undefined options to behave same as non-undefined ones, i. e. not to fire an event when the same option is selected twice.
What is the current behavior?
See above.
What are the steps to reproduce?
https://stackblitz.com/edit/angular-hbmfjn-wk5qdh
Small example in Stackblitz. Undefined option is set as default. Try opening the options list and select the undefined (
None
) option again. You can see that bothvalueChange
andngModelChange
events are fired (see the timestamps below themat-select
).You can try selecting any non-undefined option twice and observe the timestamps. You will see that the events are fired only once (after the first selection), but not again when you select the same option for the second time.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Issue occurs in both Chrome and IE on Win7. Not tested anywhere else.
Is there anything else we should know?
Probably not.
The text was updated successfully, but these errors were encountered: