From 8a4aeacc7af159dc4a73bcfff01c54ace39157fc Mon Sep 17 00:00:00 2001 From: IzaacAyelin Date: Fri, 17 May 2024 01:44:14 +0300 Subject: [PATCH 1/2] prevent scroll event before interaction --- .../src/components/gallery/proGallery/galleryContainer.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/gallery/src/components/gallery/proGallery/galleryContainer.js b/packages/gallery/src/components/gallery/proGallery/galleryContainer.js index 66d84770d..5037062b8 100644 --- a/packages/gallery/src/components/gallery/proGallery/galleryContainer.js +++ b/packages/gallery/src/components/gallery/proGallery/galleryContainer.js @@ -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] ); @@ -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, From 2f9a0f3ce12366d75fd389b7e18bd42aca69eeda Mon Sep 17 00:00:00 2001 From: IzaacAyelin Date: Fri, 17 May 2024 01:45:45 +0300 Subject: [PATCH 2/2] remove log --- .../src/components/gallery/proGallery/galleryContainer.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/gallery/src/components/gallery/proGallery/galleryContainer.js b/packages/gallery/src/components/gallery/proGallery/galleryContainer.js index 5037062b8..eb81c2692 100644 --- a/packages/gallery/src/components/gallery/proGallery/galleryContainer.js +++ b/packages/gallery/src/components/gallery/proGallery/galleryContainer.js @@ -781,7 +781,6 @@ 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,