BugiDev / BugiDev/react-native-calendar-strip

Doesn't scroll to selected date on scrolling past a certain no. of months

Open
#325 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
976
Forks
336
PR merge metrics
No merged PRs in 30d

Description

First of all, thanks for the awesome package.

Here's the issue:

**Config:**
```
{
console.log("Date selected", moment(e).format('dddd MM/DD/YYYY'));
setSelectedDate(moment(e).format('dddd MM/DD/YYYY'));
}}
dayComponentHeight={75}
scrollable
scrollerPaging
ref={calendarRef}
calendarHeaderFormat='MMMM'
style={{ height: 100 }}
calendarHeaderStyle={{ }}
calendarColor={'#fff'}
dateNumberStyle={{ }}
dateNameStyle={{ }}
highlightDateNumberStyle={{ }}
highlightDateNameStyle={{ }}
highlightDateContainerStyle={{ }}
disabledDateNameStyle={{ color: 'grey' }}
disabledDateNumberStyle={{ color: 'grey' }}
iconContainer={{ flex: 0.1 }}
useIsoWeekday={false}
startingDate={moment().day(0)}
/>
```

**Behaviour:**
On the press of a button, I'm calling
`calendarRef.current.setSelectedDate(moment(moment().format('MM/DD/YYYY'), "MM/DD/YYYY"))`

This scrolls the calendar to the current date.

However, if I scroll for quite a few months, there's a glitch and then whenever I call the above function, it does not scroll back to the current date.

(Notice the glitch as I'm scrolling towards February [the month shows September/October for a split second])

https://user-images.githubusercontent.com/40452950/134676558-131ca579-fdfc-4504-b0de-dee46bccb026.mp4

Android version: **10**
RN version: **0.63.4**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.