Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

bug(MatCalendar): @Input("startAt ") is not referenced for changes #25340

hhsissi started this conversation in Ideas
Discussion options

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

@input("startAt") is not referenced for changeDetection.

const change = minDateChange || maxDateChange || changes['dateFilter'];

There is a workaround with "activeDate", but the problem is it makes a bit heavy on developers to implement programmatic month change (as it it not useable through templates). using startAt would make ours lives much easier when it comes to changing month view.

Reproduction

Steps to reproduce:

  1. Create a component with a MatCalendar
  2. set mat-calendar "startAt" attribute in template and bind it to a property in your component (startAt) for example.
  3. change programmaticaly the startAt to another month
  4. Nothing happens (and this is a problem)

Expected Behavior

startAt updates should be referenced for changeDetection and trigger a view update.

Actual Behavior

Changing startAt value won't trigger change detection.

A workaround is changing the "activeDate", that is not referenced as an Input, therefore developers will have a hard time finding it.
Most people are actualy using internal functions like "calendar.monthView._init()" and stuff like that...

Environment

  • Angular: 14.0.4
  • Material: 14.0.4 and previous
You must be logged in to vote

Replies: 1 comment 1 reply

Comment options

Hello @hhsissi ,

Since "startAt" is for the date that the calendar opens to initially, there is no requirement that changing startAt after the calendar opens should have an effect. I'll convert this to a discussion so more developers could chime in on how to implement programmatic month change. perhaps there could be a better way to do that.

-Zach

You must be logged in to vote
1 reply
Comment options

Hi @zarend ,

Thanks for you reply / time.

Well my suggestion is already set, let's wait & see some other suggestions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
needs triage This issue needs to be triaged by the team
2 participants
Converted from issue

This discussion was converted from issue #25293 on July 26, 2022 03:41.

AltStyle によって変換されたページ (->オリジナル) /