Skip to content

bug(matDatepickerFilter): No date clickable if matDatepickerFilter is set with ".bind(this)" #21929

@felixfiskare

Description

@felixfiskare

Inside my matDatepickerFilter I need to access the component. Till Angular 9 it worked to set bind(this) on the filter Function.
Unfortunately this doesn't work no longer. Whenever I define a matDatepickerFilter in a template like this [matDatepickerFilter]="valiDateStart.bind(this)" I can't click on a month on the corresponding matDatePicker.
Once I remove the bind(this) the datePicker works again.

Reproduction

https://stackblitz.com/edit/components-issue-5tpaxb?file=src%2Fapp%2Fexample-component.html

Steps to reproduce:

  1. Click on second calender Icon
  2. Click a month on the opening popup

Expected Behavior

I would expect to see the month view for the clicked month

Actual Behavior

No reaction. The month selection view is still shown

Environment

  • Angular: Had the problem with Angular 10 and 11
  • CDK/Material: 10 & 11 as well
  • Browser(s): Current Firefox, Current Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): Currently using Fedora, haven't checked another OS yet

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions