From 6e2eaa746df70bde99e83b6fd3e491a0a93135cd Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Mon, 4 Dec 2023 16:06:15 -0800 Subject: [PATCH] Optimistically update the pager tab bar on swipe (#2083) --- src/view/com/pager/Pager.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/view/com/pager/Pager.tsx b/src/view/com/pager/Pager.tsx index d7008750..61c3609f 100644 --- a/src/view/com/pager/Pager.tsx +++ b/src/view/com/pager/Pager.tsx @@ -81,12 +81,14 @@ export const Pager = forwardRef>( if (scrollState.current === 'settling') { if (lastDirection.current === -1 && offset < lastOffset.current) { onPageSelecting?.(position) + setSelectedPage(position) lastDirection.current = 0 } else if ( lastDirection.current === 1 && offset > lastOffset.current ) { onPageSelecting?.(position + 1) + setSelectedPage(position + 1) lastDirection.current = 0 } } else {