CalendarPicker
CalendarPicker copied to clipboard
[#283] Invoking handleOnPressDay updates the visible month to the given date
Description
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 setcurrentMonth/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 tohandleOnPressDay
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 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