Skip to content

Commit

Permalink
verify horizontalElement when scrolling horizontal
Browse files Browse the repository at this point in the history
  • Loading branch information
liatv committed Mar 31, 2024
1 parent 5b13125 commit 3d6547c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/gallery/src/components/helpers/scrollHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ export function scrollToGroupImp(scrollParams) {

const rtlFix = isRTL ? -1 : 1;
//default = scroll by half the container size
if (scrollDirection === GALLERY_CONSTS.scrollDirection.HORIZONTAL) {
if (
scrollDirection === GALLERY_CONSTS.scrollDirection.HORIZONTAL &&
horizontalElement
) {
from = horizontalElement.scrollLeft;
to = from + (groupIdx * galleryWidth) / 2;
// console.log('[RTL SCROLL] scrollTogroupImp: ', from, to);
Expand Down

0 comments on commit 3d6547c

Please sign in to comment.