Skip to content

Commit

Permalink
Invoke scroll handler on pageCount change. (#14784)
Browse files Browse the repository at this point in the history
  • Loading branch information
fallaciousreasoning authored Aug 26, 2022
1 parent e4b54bd commit cc031bc
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down

0 comments on commit cc031bc

Please sign in to comment.