@@ -745,19 +745,24 @@ export default class ImageGallery extends React.Component {
745745 onClick = { slideRight } />
746746 </ span > ,
747747
748- < Swipeable
749- className = 'image-gallery-swipe'
750- key = 'swipeable'
751- delta = { 1 }
752- onSwipingLeft = { this . _handleSwiping . bind ( this , - 1 ) }
753- onSwipingRight = { this . _handleSwiping . bind ( this , 1 ) }
754- onSwiped = { this . _handleOnSwiped . bind ( this ) }
755- onSwipedLeft = { this . _handleOnSwipedTo . bind ( this , 1 ) }
756- onSwipedRight = { this . _handleOnSwipedTo . bind ( this , - 1 ) }
757- >
758- < div className = 'image-gallery-slides' >
748+ this . props . disableSwipe ?
749+ < div className = 'image-gallery-slides' key = 'slides' >
759750 { slides }
760751 </ div >
752+ :
753+ < Swipeable
754+ className = 'image-gallery-swipe'
755+ key = 'swipeable'
756+ delta = { 1 }
757+ onSwipingLeft = { this . _handleSwiping . bind ( this , - 1 ) }
758+ onSwipingRight = { this . _handleSwiping . bind ( this , 1 ) }
759+ onSwiped = { this . _handleOnSwiped . bind ( this ) }
760+ onSwipedLeft = { this . _handleOnSwipedTo . bind ( this , 1 ) }
761+ onSwipedRight = { this . _handleOnSwipedTo . bind ( this , - 1 ) }
762+ >
763+ < div className = 'image-gallery-slides' >
764+ { slides }
765+ </ div >
761766 </ Swipeable >
762767 ]
763768 :
@@ -826,6 +831,7 @@ ImageGallery.propTypes = {
826831 slideOnThumbnailHover : React . PropTypes . bool ,
827832 disableThumbnailScroll : React . PropTypes . bool ,
828833 disableArrowKeys : React . PropTypes . bool ,
834+ disableSwipe : React . PropTypes . bool ,
829835 defaultImage : React . PropTypes . string ,
830836 indexSeparator : React . PropTypes . string ,
831837 startIndex : React . PropTypes . number ,
@@ -855,6 +861,7 @@ ImageGallery.defaultProps = {
855861 slideOnThumbnailHover : false ,
856862 disableThumbnailScroll : false ,
857863 disableArrowKeys : false ,
864+ disableSwipe : false ,
858865 indexSeparator : ' / ' ,
859866 startIndex : 0 ,
860867 slideInterval : 3000
0 commit comments