Skip to content

Commit

Permalink
Focus on last clicked date, fixes plotly/dash-core-components#80
Browse files Browse the repository at this point in the history
  • Loading branch information
chriddyp committed Sep 26, 2017
1 parent 60f1ceb commit 67f94ee
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,17 @@ export default class DatePickerRange extends Component {
endDatePlaceholderText={end_date_placeholder_text}
firstDayOfWeek={first_day_of_week}
focusedInput={focusedInput}
initialVisibleMonth={() => start_date || initial_visible_month}
initialVisibleMonth={() => {
if (initial_visible_month) {
return initial_visible_month
} else {
if (focusedInput === 'endDate') {
return end_date;
} else {
return start_date;
}
}
}}
isOutsideRange={this.isOutsideRange}
isRTL={is_RTL}
keepOpenOnDateSelect={stay_open_on_select}
Expand Down

0 comments on commit 67f94ee

Please sign in to comment.