@@ -40,6 +40,7 @@ const DurationScroll = forwardRef<DurationScrollRef, DurationScrollProps>(
4040 FlatList = RNFlatList ,
4141 Haptics,
4242 initialValue = 0 ,
43+ interval,
4344 is12HourPicker,
4445 isDisabled,
4546 label,
@@ -65,8 +66,8 @@ const DurationScroll = forwardRef<DurationScrollRef, DurationScrollProps>(
6566 return 1 ;
6667 }
6768
68- return maximumValue + 1 ;
69- } , [ maximumValue ] ) ;
69+ return Math . floor ( maximumValue / interval ) + 1 ;
70+ } , [ interval , maximumValue ] ) ;
7071
7172 const safeRepeatNumbersNTimes = useMemo ( ( ) => {
7273 // do not repeat numbers if there is only one option
@@ -102,6 +103,7 @@ const DurationScroll = forwardRef<DurationScrollRef, DurationScrollProps>(
102103 repeatNTimes : safeRepeatNumbersNTimes ,
103104 disableInfiniteScroll,
104105 padWithNItems,
106+ interval,
105107 } ) ;
106108 }
107109
@@ -110,10 +112,12 @@ const DurationScroll = forwardRef<DurationScrollRef, DurationScrollProps>(
110112 repeatNTimes : safeRepeatNumbersNTimes ,
111113 disableInfiniteScroll,
112114 padWithNItems,
115+ interval,
113116 } ) ;
114117 } , [
115118 disableInfiniteScroll ,
116119 is12HourPicker ,
120+ interval ,
117121 numberOfItems ,
118122 padNumbersWithZero ,
119123 padWithNItems ,
@@ -124,6 +128,7 @@ const DurationScroll = forwardRef<DurationScrollRef, DurationScrollProps>(
124128 ( ) =>
125129 getInitialScrollIndex ( {
126130 disableInfiniteScroll,
131+ interval,
127132 numberOfItems,
128133 padWithNItems,
129134 repeatNumbersNTimes : safeRepeatNumbersNTimes ,
@@ -132,15 +137,16 @@ const DurationScroll = forwardRef<DurationScrollRef, DurationScrollProps>(
132137 [
133138 disableInfiniteScroll ,
134139 initialValue ,
140+ interval ,
135141 numberOfItems ,
136142 padWithNItems ,
137143 safeRepeatNumbersNTimes ,
138144 ]
139145 ) ;
140146
141147 const adjustedLimited = useMemo (
142- ( ) => getAdjustedLimit ( limit , numberOfItems ) ,
143- [ limit , numberOfItems ]
148+ ( ) => getAdjustedLimit ( limit , numberOfItems , interval ) ,
149+ [ interval , limit , numberOfItems ]
144150 ) ;
145151
146152 const numberOfItemsToShow = 1 + padWithNItems * 2 ;
@@ -261,6 +267,7 @@ const DurationScroll = forwardRef<DurationScrollRef, DurationScrollProps>(
261267 if ( aggressivelyGetLatestDuration ) {
262268 const newValues = getDurationAndIndexFromScrollOffset ( {
263269 disableInfiniteScroll,
270+ interval,
264271 itemHeight : styles . pickerItemContainer . height ,
265272 numberOfItems,
266273 padWithNItems,
@@ -322,6 +329,7 @@ const DurationScroll = forwardRef<DurationScrollRef, DurationScrollProps>(
322329 aggressivelyGetLatestDuration ,
323330 clickSound ,
324331 disableInfiniteScroll ,
332+ interval ,
325333 numberOfItems ,
326334 padWithNItems ,
327335 styles . pickerItemContainer . height ,
@@ -332,6 +340,7 @@ const DurationScroll = forwardRef<DurationScrollRef, DurationScrollProps>(
332340 ( e : NativeSyntheticEvent < NativeScrollEvent > ) => {
333341 const newValues = getDurationAndIndexFromScrollOffset ( {
334342 disableInfiniteScroll,
343+ interval,
335344 itemHeight : styles . pickerItemContainer . height ,
336345 numberOfItems,
337346 padWithNItems,
@@ -370,14 +379,15 @@ const DurationScroll = forwardRef<DurationScrollRef, DurationScrollProps>(
370379 onDurationChange ( newValues . duration ) ;
371380 } ,
372381 [
373- adjustedLimited . max ,
374- adjustedLimited . min ,
375- numbersForFlatList . length ,
376382 disableInfiniteScroll ,
383+ interval ,
384+ styles . pickerItemContainer . height ,
377385 numberOfItems ,
378- onDurationChange ,
379386 padWithNItems ,
380- styles . pickerItemContainer . height ,
387+ adjustedLimited . max ,
388+ adjustedLimited . min ,
389+ onDurationChange ,
390+ numbersForFlatList . length ,
381391 ]
382392 ) ;
383393
@@ -474,6 +484,7 @@ const DurationScroll = forwardRef<DurationScrollRef, DurationScrollProps>(
474484 animated : options ?. animated ?? false ,
475485 index : getInitialScrollIndex ( {
476486 disableInfiniteScroll,
487+ interval,
477488 numberOfItems,
478489 padWithNItems,
479490 repeatNumbersNTimes : safeRepeatNumbersNTimes ,
0 commit comments