Open robmv opened 1 year ago
Let me add that if I modify the Moment.js example and log the valueChanges
, there are spurious events too if I write 'a', then 'aa' and 'aaa' on the input field, the first one is the change of the value to null
, but the other two should not be triggered IMHO because the value hasn't changed, it still is null
.
I don't know if it should be interpreted as normal a valueChange
event when the value didn't change or if it should be interpreted as a bug. In all ControlValueAccessor
I have implemented, no matter what the user interaction with the control, if the result value is the same as the current one, I don't call the onChange
callback, so I am inclined to think that it is a bug on the date and date range pickers.
Is this a regression?
The previous version in which this bug was not present was
No response
Description
When a date range picker is opened and the start date is selected, two consecutive
valueChanges
event are triggered, and after the end date is selected the final event is triggered, in total 3 events happens instead of only two.Reproduction
StackBlitz link: https://stackblitz.com/edit/shrtut? Steps to reproduce:
mat-datepicker-toggle
button.Expected Behavior
After selecting the first date only a single
valueChanges
event should be triggered.The expected behavior is show on the Workaround Changes section where a
debounceTime(0)
is forced in order to remove the spurious repeated event.Actual Behavior
Two events are triggered after selecting the start date
Environment