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

Ensuring callbacks will execute after new state is ready. #990

Merged
merged 4 commits into from
Feb 1, 2018
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/components/DayPickerRangeController.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -621,9 +621,9 @@ export default class DayPickerRangeController extends React.Component {
...newVisibleDays,
...this.getModifiers(prevMonthVisibleDays),
},
}, () => {
onPrevMonthClick(newCurrentMonth.clone());
});

onPrevMonthClick(newCurrentMonth.clone());
}

onNextMonthClick() {
Expand All @@ -645,9 +645,10 @@ export default class DayPickerRangeController extends React.Component {
...newVisibleDays,
...this.getModifiers(nextMonthVisibleDays),
},
}, () => {
onNextMonthClick(newCurrentMonth.clone());
});

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to delete this blank line

onNextMonthClick(newCurrentMonth.clone());
}

onMultiplyScrollableMonths() {
Expand Down
8 changes: 4 additions & 4 deletions src/components/DayPickerSingleDateController.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,9 @@ export default class DayPickerSingleDateController extends React.Component {
...newVisibleDays,
...this.getModifiers(prevMonthVisibleDays),
},
}, () => {
onPrevMonthClick(prevMonth.clone());
});

onPrevMonthClick(prevMonth.clone());
}

onNextMonthClick() {
Expand All @@ -386,9 +386,9 @@ export default class DayPickerSingleDateController extends React.Component {
...newVisibleDays,
...this.getModifiers(nextMonthVisibleDays),
},
}, () => {
onNextMonthClick(newCurrentMonth.clone());
});

onNextMonthClick(newCurrentMonth.clone());
}


Expand Down