diff options
author | dan <dan.abramov@gmail.com> | 2023-11-06 22:30:10 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-06 22:30:10 +0000 |
commit | d715246e26728ef55408deeb09a3721e39c5031e (patch) | |
tree | afc873d7833c1407c3e154c3132fc849df77dcf1 /src/view/com/pager/TabBar.tsx | |
parent | 4c00fc576d66b0a348b4fb13b901a464da64cf37 (diff) | |
download | voidsky-d715246e26728ef55408deeb09a3721e39c5031e.tar.zst |
Fix sticky pager jumps (#1825)
* Defer showing pager content until its header settles * Introduce the concept of headerOnlyHeight * Keep headerOnlyHeight in state, make headerHeight derived * Hide content until *both* header (only) and tabbar are measured * Hide tabbar to read its layout earlier * Give consistent keys to pages
Diffstat (limited to 'src/view/com/pager/TabBar.tsx')
-rw-r--r-- | src/view/com/pager/TabBar.tsx | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/view/com/pager/TabBar.tsx b/src/view/com/pager/TabBar.tsx index 662d73668..0e08b22d8 100644 --- a/src/view/com/pager/TabBar.tsx +++ b/src/view/com/pager/TabBar.tsx @@ -14,7 +14,6 @@ export interface TabBarProps { indicatorColor?: string onSelect?: (index: number) => void onPressSelected?: (index: number) => void - onLayout?: (evt: LayoutChangeEvent) => void } export function TabBar({ @@ -24,7 +23,6 @@ export function TabBar({ indicatorColor, onSelect, onPressSelected, - onLayout, }: TabBarProps) { const pal = usePalette('default') const scrollElRef = useRef<ScrollView>(null) @@ -68,7 +66,7 @@ export function TabBar({ const styles = isDesktop || isTablet ? desktopStyles : mobileStyles return ( - <View testID={testID} style={[pal.view, styles.outer]} onLayout={onLayout}> + <View testID={testID} style={[pal.view, styles.outer]}> <DraggableScrollView horizontal={true} showsHorizontalScrollIndicator={false} |