-
-
Notifications
You must be signed in to change notification settings - Fork 155
feat(Calendar): add onVisibleMonthsChange callback to calendars and date pickers #1382
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
base: main
Are you sure you want to change the base?
Conversation
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
Hey there @hmnd! We typically don't expose listeners/handlers for properties that we don't adjust internally, meaning the To determine what months are visible, you can use a combination of the |
Hey @huntabyte, thanks for taking a look at this. As far as I'm aware, Thus I think either a handler like I've implemented or a read-only binding to |
Ah, I see what you mean. I was thinking of |
Happy to discuss/provide feedback in chat on discord if preferred too - Thanks! |
🦋 Changeset detectedLatest commit: 1a2c890 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
2cedeba
to
4d63616
Compare
4d63616
to
1a2c890
Compare
Resolves part of #1379
Adds
onVisibleMonthsChange
callback to both calendars and both date pickers. This allows end users to react to the displayed dates changing, eg. in order to load relevant availability data as the user navigates.I followed the approach currently used for the
onStartValueChange
callback, but am open to feedback if a different approach might be better.I ran into an issue where setting the initial months within the constructor on the boxed months value wouldn't trigger an update to relevant getters server-side. That resulted in a blank calendar rendering server side before populating client side. My workaround is to have an internal getter for months that defaults to the initial months when the boxed months array is blank.