Skip to content

Commit

Permalink
fix thumbnail onClick navigation RTL (#1164)
Browse files Browse the repository at this point in the history
  • Loading branch information
liatv authored Oct 2, 2023
1 parent 227c473 commit a4939d1
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,11 @@ class SlideshowView extends React.Component {
//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 = itemIdx - this.state.activeIndex;
const isRTL =
this.props.options.behaviourParams_gallery_layoutDirection ===
GALLERY_CONSTS[optionsMap.behaviourParams.gallery.layoutDirection].RIGHT_TO_LEFT;

const direction = isRTL ? this.state.activeIndex - itemIdx : itemIdx - this.state.activeIndex;
return this.next({
direction,
isAutoTrigger: false,
Expand Down

0 comments on commit a4939d1

Please sign in to comment.