0

Im using matDatepickerFilter from mat-datepicker(Angular Material), if my data change when panel is open, it is not updated, as if there was a ChangeDetectionStrategy issue.

How can I force change detection ?

I have created a blitz.

To try it:

  • click on input

  • wait for 2 seconds

  • click on disabled date for refresh panel.

Thanks for you help.

dahh
  • 3
  • 2
  • I would not update the datepicker asynchronously with the dates that the user can or cannot select, as this is very error prone. Currently it would be possible for the user to select a date that might be filtered out, but the async request has not yet returned that data. Ideally the component would fetch the available dates in `ngOnInit` and only display the datepicker once the dates are available (using `ngIf` in the template). – Fabian Küng Apr 10 '19 at 09:22
  • Thanks! If I didn't find another solution to used it, i will do it. – dahh Apr 10 '19 at 09:46
  • I made it work close and open the panel to refresh it. I have created a [blitz](https://angular-vgqzoy.stackblitz.io). – dahh May 07 '19 at 11:05

0 Answers0