Skip to content

Commit 0d628cf

Browse files
throttling can cause the count not to update. From testing with react dev tools this seems to not cause much issue as it is only updating state if the card count changes
1 parent 4c1a8c5 commit 0d628cf

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

dotcom-rendering/src/components/ScrollableCarousel.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -464,14 +464,11 @@ export const ScrollableCarousel = ({
464464
if (!carouselElement) return;
465465
if (!isArticle) return;
466466

467-
carouselElement.addEventListener(
468-
'scroll',
469-
throttleEvent(updateCardCountOnScroll),
470-
);
467+
carouselElement.addEventListener('scroll', updateCardCountOnScroll);
471468
return () => {
472469
carouselElement.removeEventListener(
473470
'scroll',
474-
throttleEvent(updateCardCountOnScroll),
471+
updateCardCountOnScroll,
475472
);
476473
};
477474
}, [isArticle, updateCardCountOnScroll]);

0 commit comments

Comments
 (0)