Skip to content

Commit

Permalink
prevent scroll event before interaction
Browse files Browse the repository at this point in the history
  • Loading branch information
IzaacAyelin committed May 16, 2024
1 parent ab04ca6 commit 8a4aeac
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,10 @@ export class GalleryContainer extends React.Component {
}
if (eventName === GALLERY_CONSTS.events.CURRENT_ITEM_CHANGED) {
this.setCurrentSlideshowViewIdx(eventData.idx);
if (this.getIsScrollLessGallery(this.state.options)) {
if (
this.getIsScrollLessGallery(this.state.options) &&
this.state.firstUserInteractionExecuted
) {
this.simulateHorizontalScrollToItem(
this.galleryStructure.items[eventData.idx]
);
Expand Down Expand Up @@ -778,6 +781,7 @@ export class GalleryContainer extends React.Component {
}

if (eventName === GALLERY_CONSTS.events.GALLERY_SCROLLED) {
console.log('GALLERY_SCROLLED ==>');
this.videoScrollHelper.trigger.SCROLL(eventData);
const newScrollPosition = {
...this.state.scrollPosition,
Expand Down

0 comments on commit 8a4aeac

Please sign in to comment.