-
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
bug(mat-datepicker): value change firing on filter re assign #20967
Comments
…swapped out if result is the same Doesn't invoke the `ControlValueAccessor` change function when a new date filter is assigned, if the result wouldn't have change the validation state. Fixes angular#20967.
…swapped out if result is the same Doesn't invoke the `ControlValueAccessor` change function when a new date filter is assigned, if the result wouldn't have change the validation state. Fixes angular#20967.
We can't do a whole lot here, because we only tell the validator to revalidate and then it determines on its own whether to dispatch the change event. I've submitted #20970 which will prevent the event from firing if a new function with the same result is called, but that won't fix your example, because the validation state changes on each assignment ( |
still does not make sense that a change event is fired for the same value regardless of validation result? fyi (dateChange) event is not triggered for the same. as a side note: [matDatepickerFilter] does not work with the async pipe: Type '((date: Date | null) => boolean) | null' is not assignable to type 'DateFilterFn<Date | null>' |
We have control over |
…swapped out if result is the same Doesn't invoke the `ControlValueAccessor` change function when a new date filter is assigned, if the result wouldn't have change the validation state. Fixes angular#20967.
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. |
…swapped out if result is the same (angular#20970) Doesn't invoke the `ControlValueAccessor` change function when a new date filter is assigned, if the result wouldn't have change the validation state. Fixes angular#20967.
Reproduction
https://stackblitz.com/edit/angular-ivy-eaktsw?devtoolsheight=33&file=src/app/app.component.ts
Steps to reproduce:
open stackblitz, look at console output, value change triggered incorrectly
Expected Behavior
value change to fire only when value has changed, not when filter changes
Actual Behavior
value change firing for same values
Environment
The text was updated successfully, but these errors were encountered: