-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Setting min/max property can change current month, but doesn't emit event #63
Comments
Can you provide a codepen or similar showing your issue? I don't have a great deal of spare time to dig into this myself at the moment, and a minimal reproduction would really help. Thanks! |
Yes, no problem - here's a codepen: It logs to a box when the
You can also navigate to October and see the I hope this is useful, and thank you for your time. |
I've been digging into the code, specifically CalendarDate and useCalendarBase. It would be great if the calendar emitted a focusedDate (focusday event) which took into account the min and max though. Thank you! |
Thanks! I'll take a look at this later in the week and try to find a reasonable solution. I'm not overly keen on firing events, since they are generally reserved for user initiated changes not programmatic changes. But it may be the only option here. Will keep you posted! |
If you set the
min
ormax
properties of<calendar-date>
, this can have the effect of automatically changing the currently showing month, because the current or default month is no longer accessible.The problem with that is if you're rendering your own
<select>
elements in the header for changing the year and month, you need to know when the month/year changes, to be able to update the selected options in those elements.As far as I can tell though, no event is emitted in this scenario, which would be ideal. Similar to "focusday".
The way I'm trying to get around this is by having a function which I call to set the max/min property, and at the same time update my
<select>
elements. The problem is I don't actually know what month is definitely showing, because by default thefocusedDate
property isundefined
, and doesn't change as a result of setting themax
ormin
properties.Any guidance would be appreciated!
The text was updated successfully, but these errors were encountered: