Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: #767 . #788

Merged
merged 8 commits into from
Feb 27, 2024
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;
//so basically is the list is right to left (isRTL), the logic is inversed
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

grammar fix here:

// When isRTL is true, the logic is reversed

Copy link
Owner

@xiaolin xiaolin Feb 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I would rather have the comment removed because the code you've provided is self-explanatory. But since you left a comment, it will alert a contributor to read it, so it should be clear and concise.

Copy link
Contributor Author

@hunxjunedo hunxjunedo Feb 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alright. A side note, it's my first time contributing to kindly excuse any inconvenience caused.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No inconvenience at all, this is part of the code review process. Thank you for contributing!

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();
xiaolin marked this conversation as resolved.
Show resolved Hide resolved
}

canSlidePrevious() {
Expand Down
Loading