stephy / CalendarPicker

CalendarPicker Component for React Native
802 stars 371 forks source link

Problem when changing month or year #221

Open IronTony opened 4 years ago

IronTony commented 4 years ago

Hi and thank you for the package. I just have a problem, maybe I am doing something wrong, but I saw that when I tap on the header bar, on month or year, I can select another month or another year. Unfortunately when I try to change the month/year, the calendar days section doesn't update until I press next or previous.

This is the part I am talking about: image

peacechen commented 4 years ago

That sounds like a bug. Are you using the scrollable prop? Please post a code snippet of your <CalendarStrip>

IronTony commented 4 years ago

Nope, not using scrollable. I will post a snippet of code during this weekend. Thank you

MannySauce commented 4 years ago

@IronTony I'm also facing this issue did you solve it? (not using scrollable either)

edit: here is code snippet

const minDate = new Date(); // Today const maxDate = new Date(2017, 6, 3);

<CalendarPicker allowRangeSelection={true} maxDate={maxDate} minDate={minDate} weekdays={weekdays} months={months} initialDate={maxDate} restrictMonthNavigation={true} todayBackgroundColor={'#fff'} selectedDayColor={'#000'} selectedDayTextColor="#fff" allowBackwardRangeSelect={true} scaleFactor={375} height={420} startFromMonday={true} todayTextStyle={{color: 'green'}} onDateChange={onDateChange} />

IronTony commented 4 years ago

did the same thing. no solution actually 😢

peacechen commented 4 years ago

Sorry I've not been able to look into this. It will be a while until I have time to debug it. In the meantime, set breakpoints in node_modules/react-native-calendar-picker/CalendarPicker/index.js and any other relevant files to determine what may be causing this bug.

saaketnarnolia commented 4 years ago

same issue being faced by me

daominh commented 4 years ago

I found temporary solution. In node_modules/react-native-calendar-picker/CalendarPicker/index.js call this.handleOnPressFinisher({year: year, month: month}); inside the handleOnSelectMonthYear() function.

peacechen commented 4 years ago

Thanks for sharing your solution @daominh Would you mind submitting a PR? Please test with and without the scrollable prop.

saaketnarnolia commented 4 years ago

this problem started with the version 7.0.0

peacechen commented 4 years ago

Thanks for your patience. This has been fixed in 7.0.1