Skip to content

Commit

Permalink
FIX: #767 . (#788)
Browse files Browse the repository at this point in the history
* fixed issue #767

* removed semi-colons

* add semi-colons

* fixed all errors shown by eslint

* applied changes according to review, fixed issue #767

* fixed RTL slide issue. BTW why is grammar emphasized this much ?

* Update src/components/ImageGallery.jsx

* Update src/components/ImageGallery.jsx

---------

Co-authored-by: Xiao Lin <[email protected]>
  • Loading branch information
hunxjunedo and xiaolin committed Feb 27, 2024
1 parent f8b9817 commit 4f81d93
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/components/ImageGallery.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 4f81d93

Please sign in to comment.