BugiDev / react-native-calendar-strip

Easy to use and visually stunning calendar component for React Native.
MIT License
939 stars 327 forks source link

Feature Request: Auto-center on `selectedDate` #200

Open jasonmichaels opened 4 years ago

jasonmichaels commented 4 years ago

First off, love the CalendarStrip component. I may ultimately fork it to add functionality and then check back in if I'm able to do these myself. Here's the request -- if it's possible with the current props, though, let me know!

Scenario:

As a user, I want to select a date and have the strip automatically center that date. Until I select another date, the currently selected date should stay centered. UX-wise, this means dates would scroll behind the centered date until a new date is selected; once selected, the new selectedDate would automatically center.

peacechen commented 4 years ago

A drawing would help me better understand what you're envisioning. A couple scenarios:

PR's are welcome and I encourage you to contribute back to this project.

Edwin-pococode commented 3 years ago

Hi peacechen, thank you for the response. I think Jason's case is the same one that we currently require. So to elaborate, lets say you select the 1st (lets say its a 5) item in the strip, then the lists rotates to make that item the 4th item in the list (the middle item). So now 5 will display in the middle as the 4th item. Is that currently possible?

Thanks!

peacechen commented 3 years ago

That would be possible when used with the scollable prop. A new method e.g. scrollToDate would need to be exposed. Please submit a PR with that feature. TBH while that sounds great in theory, it would be disruptive for users. Every time they click on a date, the calendar strip spontaneously scrolls away (in your example it would scroll backwards a few days).