diff --git a/src/components/ImageGallery.jsx b/src/components/ImageGallery.jsx index 8b11785a..e4ab0792 100644 --- a/src/components/ImageGallery.jsx +++ b/src/components/ImageGallery.jsx @@ -763,13 +763,14 @@ class ImageGallery extends React.Component { } canSlideLeft() { - const { infinite } = this.props; - return infinite || this.canSlidePrevious(); + const { infinite, isRTL } = this.props; + // reverse the logic if the slider has isRTL enabled + return infinite || (isRTL ? this.canSlideNext() : this.canSlidePrevious()); } canSlideRight() { - const { infinite } = this.props; - return infinite || this.canSlideNext(); + const { infinite, isRTL } = this.props; + return infinite || (isRTL ? this.canSlidePrevious() : this.canSlideNext()); } canSlidePrevious() {