From e4a66cb5d3c042cc4422172700b7d366a10c95bd Mon Sep 17 00:00:00 2001 From: liatv Date: Sun, 28 Jan 2024 09:36:30 +0200 Subject: [PATCH] [FIX] - fix scrollIndication hydration exception --- .../components/gallery/proGallery/galleryScrollIndicator.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/gallery/src/components/gallery/proGallery/galleryScrollIndicator.js b/packages/gallery/src/components/gallery/proGallery/galleryScrollIndicator.js index 8f9a7257c..dec5d2cb1 100644 --- a/packages/gallery/src/components/gallery/proGallery/galleryScrollIndicator.js +++ b/packages/gallery/src/components/gallery/proGallery/galleryScrollIndicator.js @@ -82,9 +82,8 @@ export default class ScrollIndicator extends React.Component { this.props.galleryScrollDirection === GALLERY_CONSTS[optionsMap.layoutParams.structure.scrollDirection].HORIZONTAL ) { try { - scrollingElement.horizontal().addEventListener('scroll', this.onHorizontalScroll); - - scrollingElement.horizontal().addEventListener('scrollTransition', this.onHorizontalScrollTransition); + scrollingElement?.horizontal()?.addEventListener('scroll', this.onHorizontalScroll); + scrollingElement?.horizontal()?.addEventListener('scrollTransition', this.onHorizontalScrollTransition); } catch (e) { console.error(e); }