File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -324,16 +324,26 @@ class Carousel extends React.PureComponent<CarouselProps, CarouselState> {
324324
325325 scrollToStart = ( ) => {
326326 this . scrollview ?. current ?. scrollTo ( {
327- x : this . props . vertical ? 0 : this . state . width ,
328- y : this . props . vertical ? this . state . height : 0 ,
327+ x : this . props . vertical ? 0 : this . props . infinite ? this . state . width : 0 ,
328+ y : this . props . vertical
329+ ? this . props . infinite
330+ ? this . state . height
331+ : 0
332+ : 0 ,
329333 animated : false ,
330334 } )
331335 }
332336
333337 scrollToEnd = ( ) => {
334338 this . scrollview ?. current ?. scrollTo ( {
335- x : this . props . vertical ? 0 : this . state . width * this . count ,
336- y : this . props . vertical ? this . state . height * this . count : 0 ,
339+ x : this . props . vertical
340+ ? 0
341+ : this . state . width *
342+ ( this . props . infinite ? this . count : this . count - 1 ) ,
343+ y : this . props . vertical
344+ ? this . state . height *
345+ ( this . props . infinite ? this . count : this . count - 1 )
346+ : 0 ,
337347 animated : false ,
338348 } )
339349 }
You can’t perform that action at this time.
0 commit comments