From 3cdf536c66348e64a768b919a0092c655f3e534c Mon Sep 17 00:00:00 2001 From: liatvi Date: Sun, 28 Jan 2024 09:47:51 +0200 Subject: [PATCH] [FIX] - fix scrollIndication hydration exception (#1180) --- .../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); }