React-day-picker: Prevents change the month when click in outside days

Created on 12 Jul 2017  路  3Comments  路  Source: gpbl/react-day-picker

Hi,

I need use the enableOutsideDays but I don't want the month changes when on I click in these days.

Is it possible?

All 3 comments

mmm I don't think it is possible... maybe you can find a workaroud with onDayClick:

handleDayClick = (day, { outside }) => {
  if (outside) {
     // show another month
     this.daypicker.showMonth(this.state.currentMonth);
  }
}

render() {
  return (
    <DayPicker 
       month={this.state.currentMonth} 
       onDayClick={this.handleDayClick} 
       ref={el => this.daypicker = el } 
    />
  )
}

I'm having issues with this too, and wish there was a prop to turn off changing months when clicking outside days.

Is there any hacks or new API to do this trick now?

Was this page helpful?
0 / 5 - 0 ratings