stephy / CalendarPicker

CalendarPicker Component for React Native
798 stars 371 forks source link

enableDateChange not working #145

Closed ghost closed 5 years ago

ghost commented 5 years ago

Example

<CalendarPicker ref={this.setCalendarRef} startFromMonday={true} allowRangeSelection={true} minDate={minDate} maxDate={maxDate} todayTextStyle={{fontWeight: 'bold'}} todayBackgroundColor={'transparent'} selectedDayColor={Theme.palette.primary} selectedDayTextColor="#FFFFFF" width={deviceWidth-75} selectedStartDate={selectedStartDate} selectedEndDate={selectedEndDate} initialDate={selectedStartDate} enableDateChange={false} />

Expected Behaviour enableDateChange={false} should block updating dates, which it does not do graphically.

peacechen commented 5 years ago

Thanks for reporting this. It looks like the touch handler isn't looking at the enableDateChange prop. https://github.com/stephy/CalendarPicker/blob/master/CalendarPicker/Day.js#L161

That prop will need to be passed down from parent to child 2 layers deep. Would you like to create a PR?