Addresses this issue where invoking the handleOnPressDay(date) method doesn't update the visible month to the one that contains date.
Changes
updated handleOnPressDay method to set currentMonth/Year
updated example app to demonstrate use case
Limitations
I'm not sure if we always want the behaviour where invoking handleOnPressDay updates the visible month. If not, we could consider adding a boolean argument to handleOnPressDay for whether the visible month should be updated
there's another code path in handleOnPressDay for when range selection is enabled that I didn't address. I'm not as familiar with this feature so I didn't want to impose a product decision here
my fix doesn't seem to work when scrollable is set to true
Description
Addresses this issue where invoking the
handleOnPressDay(date)
method doesn't update the visible month to the one that containsdate
.Changes
handleOnPressDay
method to setcurrentMonth/Year
Limitations
handleOnPressDay
updates the visible month. If not, we could consider adding a boolean argument tohandleOnPressDay
for whether the visible month should be updatedhandleOnPressDay
for when range selection is enabled that I didn't address. I'm not as familiar with this feature so I didn't want to impose a product decision herescrollable
is set totrue
Demo
Before
https://github.com/stephy/CalendarPicker/assets/144704010/ec26f3ed-694f-4092-bc94-12a172db822f
After
https://github.com/stephy/CalendarPicker/assets/144704010/645e3594-7410-4c5a-bc5a-7e673ec3de3c