File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -565,6 +565,7 @@ class CalendarStrip extends Component {
565565 onWeekScrollStart = { this . props . onWeekScrollStart }
566566 onWeekScrollEnd = { this . props . onWeekScrollEnd }
567567 externalScrollView = { this . props . externalScrollView }
568+ scrollToOnSetSelectedDate = { this . props . scrollToOnSetSelectedDate }
568569 />
569570 ) ;
570571 }
Original file line number Diff line number Diff line change @@ -25,12 +25,14 @@ export default class CalendarScroller extends Component {
2525 onWeekScrollStart : PropTypes . func ,
2626 onWeekScrollEnd : PropTypes . func ,
2727 externalScrollView : PropTypes . func ,
28- pagingEnabled : PropTypes . bool
28+ pagingEnabled : PropTypes . bool ,
29+ scrollToOnSetSelectedDate : PropTypes . bool
2930 }
3031
3132 static defaultProps = {
3233 data : [ ] ,
3334 renderDayParams : { } ,
35+ scrollToOnSetSelectedDate : true
3436 } ;
3537
3638 constructor ( props ) {
@@ -128,6 +130,8 @@ export default class CalendarScroller extends Component {
128130
129131 // Scroll to given date, and check against min and max date if available.
130132 scrollToDate = ( date ) => {
133+ if ( ! this . props . scrollToOnSetSelectedDate ) return ;
134+
131135 let targetDate = moment ( date ) . subtract ( Math . round ( this . state . numVisibleItems / 2 ) - 1 , "days" ) ;
132136 const {
133137 minDate,
You can’t perform that action at this time.
0 commit comments