Selecting reset option in mat-select
See original GitHub issueBug, 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, both valueChange
and ngModelChange
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 both valueChange
and ngModelChange
events are fired (see the timestamps below the mat-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.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:28
- Comments:10
Top GitHub Comments
Is there any thing new with this issue? Every other work around isn’t really a solution.
What’s the status on this issue? Any chance it will be merged anytime soon?