@@ -424,45 +424,50 @@ class Carousel extends React.Component {
424424 }
425425 }
426426 }
427- func ( ) ;
427+ // we are not "tilting" on edges, so we need to reset isSwiping and transitioning.
428+ // otherwise we wont slide back to edge
429+ this . setState ( { isSwiping : false , transitioning : false } ) ;
430+ func ( { skipTilt : true } ) ;
428431 } ;
429432
430- onNextStart = ( ) => {
433+ onNextStart = options => {
431434 const { onNextStart } = this . props ;
432435 const { activeIndex } = this . state ;
433436 const nextItemObj = this . getNextItemObj ( ) ;
434437 const prevItemObj = this . convertChildToCbObj ( activeIndex ) ;
435438 onNextStart ( prevItemObj , nextItemObj ) ;
436- this . slideNext ( ) ;
439+ this . slideNext ( options ) ;
437440 } ;
438441
439- onPrevStart = ( ) => {
442+ onPrevStart = options => {
440443 const { onPrevStart } = this . props ;
441444 const { activeIndex } = this . state ;
442445 const nextItemObj = this . getNextItemObj ( true ) ;
443446 const prevItemObj = this . convertChildToCbObj ( activeIndex ) ;
444447 onPrevStart ( prevItemObj , nextItemObj ) ;
445- this . slidePrev ( ) ;
448+ this . slidePrev ( options ) ;
446449 } ;
447450
448- slideNext = ( ) => {
451+ slideNext = ( options = { } ) => {
452+ const { skipTilt } = options ;
449453 const { enableTilt } = this . props ;
450454 const { activeIndex, sliderPosition } = this . state ;
451455 const nextItem = this . getNextItemIndex ( activeIndex , false ) ;
452456 if ( activeIndex !== nextItem ) {
453457 this . goTo ( nextItem ) ;
454- } else if ( enableTilt ) {
458+ } else if ( enableTilt && ! skipTilt ) {
455459 this . tiltMovement ( sliderPosition , 20 , 150 ) ;
456460 }
457461 } ;
458462
459- slidePrev = ( ) => {
463+ slidePrev = ( options = { } ) => {
464+ const { skipTilt } = options ;
460465 const { activeIndex } = this . state ;
461466 const { enableTilt } = this . props ;
462467 const prevItem = this . getNextItemIndex ( activeIndex , true ) ;
463468 if ( activeIndex !== prevItem ) {
464469 this . goTo ( prevItem ) ;
465- } else if ( enableTilt ) {
470+ } else if ( enableTilt && ! skipTilt ) {
466471 this . tiltMovement ( 0 , - 20 , 150 ) ;
467472 }
468473 } ;
0 commit comments