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 tumbnail item click rtl v4 new #1167

Merged
merged 3 commits into from
Oct 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -488,14 +488,18 @@ class SlideshowView extends React.Component {
GALLERY_CONSTS.events.THUMBNAIL_CLICKED,
this.props
);
this.scrollToIndex({ itemIdx, scrollDuration });
this.scrollToIndex({
itemIdx,
scrollDuration,
isRTL: this.props.options.isRTL,
});
}

scrollToIndex({ itemIdx, scrollDuration }) {
scrollToIndex({ itemIdx, scrollDuration, isRTL }) {
//not to confuse with this.props.actions.scrollToItem. this is used to replace it only for thumbnail items
this.props.setGotFirstScrollIfNeeded(); //load all the images in the thumbnails bar

const direction = this.options.isRTL
const direction = isRTL
? this.state.activeIndex - itemIdx
: itemIdx - this.state.activeIndex;
return this.next({
Expand Down Expand Up @@ -972,7 +976,7 @@ class SlideshowView extends React.Component {
// previousItem,
// previousGroup,
toIndex: (itemIdx) =>
this.scrollToIndex({ itemIdx, scrollDuration: 400 }),
this.scrollToIndex({ itemIdx, scrollDuration: 400, isRTL }),
// getCurrentActiveItemIndex,
// getCurrentActiveGroupIndex,
assignIndexChangeCallback: (func) => {
Expand Down
Loading