Skip to content
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

feat(MatCalendar): Allow to turn focus off on change inputs to MatCalendar #30635

Open
worthy7 opened this issue Mar 15, 2025 · 1 comment
Open
Labels
feature This issue represents a new feature or feature request rather than a bug or bug fix needs triage This issue needs to be triaged by the team

Comments

@worthy7
Copy link

worthy7 commented Mar 15, 2025

Feature Description

Add some option so that MatCalendar does not take focus when it's inputs are changed.

Use Case

Thank you for making a very beautiful calendar/date picker for material 🙂

I am using the calendar and dynamically deciding which dates are selectable or not from some backend service.

When the user changes month, it requests the available dates, and updates the myFilter observable which produces a new function, which causes MatCalendar to recheck all the shown dates to see if it should disable that date or not.

This works great, but the issue is that sometimes the data is updated by other things - not month change - that are on a different part of the screen. The available dates will update, the observable pushes a new filter function.

The problem is that this causes the MatCalendar to take focus, and scrolls my user from wherever they are on the screen, I cannot allow this but don't see a way to solve it without disabling the filter all-together.

@worthy7 worthy7 added feature This issue represents a new feature or feature request rather than a bug or bug fix needs triage This issue needs to be triaged by the team labels Mar 15, 2025
@worthy7
Copy link
Author

worthy7 commented Mar 15, 2025

I made a stack to demo the problem, just click the button. Thank you.

https://stackblitz.com/edit/rgd39p5b?file=src%2Fexample%2Fdatepicker-inline-calendar-example.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This issue represents a new feature or feature request rather than a bug or bug fix needs triage This issue needs to be triaged by the team
Projects
None yet
Development

No branches or pull requests

1 participant