CalendarPicker icon indicating copy to clipboard operation
CalendarPicker copied to clipboard

[#283] Invoking handleOnPressDay updates the visible month to the given date

Open milan-digiuseppe-level opened this issue 2 weeks ago • 0 comments

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 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

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

milan-digiuseppe-level avatar Jun 26 '24 16:06 milan-digiuseppe-level