From cc031bcbfa82821d138b55c8318882a6838afd59 Mon Sep 17 00:00:00 2001 From: Jay Harris <7678024+fallaciousreasoning@users.noreply.github.com> Date: Fri, 26 Aug 2022 16:14:51 +1200 Subject: [PATCH] Invoke scroll handler on pageCount change. (#14784) --- .../brave_new_tab_ui/containers/newTab/gridPageButtons.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/components/brave_new_tab_ui/containers/newTab/gridPageButtons.tsx b/components/brave_new_tab_ui/containers/newTab/gridPageButtons.tsx index 74964e5d0e72..762e7234aede 100644 --- a/components/brave_new_tab_ui/containers/newTab/gridPageButtons.tsx +++ b/components/brave_new_tab_ui/containers/newTab/gridPageButtons.tsx @@ -83,6 +83,7 @@ export const GridPageButtons = (props: { numPages: number, pageContainerRef: Rea indicatorRef.current?.setAttribute('style', `transform: translateX(${translationX}%)`) } el.addEventListener('scroll', scrollHandler) + scrollHandler() return () => el.removeEventListener('scroll', scrollHandler) }, [props.pageContainerRef, props.numPages])