Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DayPickerInput doesn't call dayPickerProps.onMonthChange #603

Closed
ah-adarlow opened this issue Jan 8, 2018 · 1 comment · Fixed by #604
Closed

DayPickerInput doesn't call dayPickerProps.onMonthChange #603

ah-adarlow opened this issue Jan 8, 2018 · 1 comment · Fixed by #604
Labels
good first issue Good for newcomers

Comments

@ah-adarlow
Copy link
Contributor

ah-adarlow commented Jan 8, 2018

DayPickerInput overrides the onMonthChange handler passed in through dayPickerProps and doesn't call it when the month changes.

See DayPickerInput.js line 446.

https://codesandbox.io/s/km00lz2vq3

@gpbl gpbl added bug good first issue Good for newcomers labels Jan 8, 2018
@gpbl
Copy link
Owner

gpbl commented Jan 8, 2018

Confirmed! Someone may want to fix it :)

- onMonthChange={month => this.setState({ month })}
+ onMonthChange={this.handleMonthChange}
  • handleMonthChange should setState({month}) and use as callback props.dayPickerProps.onMonthChange –if it exists– with the same args
  • must add a test for handleMonthChange calling onMonthChange

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants