-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
DayPickerSingleDateController Jump to current month on date prop change #1320
Copy link
Copy link
Closed
Labels
feature requestI want a new feature in react-dates!I want a new feature in react-dates!pull request wantedThis is a great way to contribute! Help us out :-DThis is a great way to contribute! Help us out :-D
Description
Here's my simple component
<DayPickerSingleDateController
date={getDateFromUrl(this.props.router)}
focused
numberOfMonths={1}
onDateChange={console.log}
onFocusChange={noop}
/>My URLs are in the format /date/${yyyy}/${mm}/${dd}, and the getDateFromUrl() function just transforms the URL into a momentObject.
Repro:
- Load page /date/2017/01/01, the DayPickerSingleDateController will highlight Jan 1st 2017.
- Navigate client side (i.e. no page refresh) to /date/2018/01/01
Expected result:
- DayPickerSingleDateController changes its visible month to Jan 2018
Actual result:
- DayPickerSingleDateController stays as Jan 2017.
- Jan 1st 2017 gets un-highlighted (this is good)
- If I manually scroll to Jan 2018, I see Jan 1st 2018 being hightlighted (which means the
dateprop has correctly been changed)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feature requestI want a new feature in react-dates!I want a new feature in react-dates!pull request wantedThis is a great way to contribute! Help us out :-DThis is a great way to contribute! Help us out :-D