File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -137,6 +137,12 @@ const CalendarList = (props: CalendarListProps & ContextProp, ref: any) => {
137137 } ) ;
138138 } , [ items ] ) ;
139139
140+ const getDateIndex = useCallback ( ( date : string ) => {
141+ return findIndex ( items , function ( item ) {
142+ return item . toString ( ) === date . toString ( ) ;
143+ } ) ;
144+ } , [ items ] ) ;
145+
140146 useEffect ( ( ) => {
141147 if ( current ) {
142148 scrollToMonth ( new XDate ( current ) ) ;
@@ -188,7 +194,7 @@ const CalendarList = (props: CalendarListProps & ContextProp, ref: any) => {
188194
189195 const addMonth = useCallback ( ( count : number ) => {
190196 const day = currentMonth ?. clone ( ) . addMonths ( count , true ) ;
191- if ( sameMonth ( day , currentMonth ) ) {
197+ if ( sameMonth ( day , currentMonth ) || getDateIndex ( day ) === - 1 ) {
192198 return ;
193199 }
194200 scrollToMonth ( day ) ;
@@ -280,7 +286,7 @@ const CalendarList = (props: CalendarListProps & ContextProp, ref: any) => {
280286 onViewableItemsChanged
281287 } ,
282288 ] ) ;
283-
289+
284290 return (
285291 < View style = { style . current . flatListContainer } testID = { testID } >
286292 < FlatList
You can’t perform that action at this time.
0 commit comments