From 5090426f9c19f7c372b4426544790683b63b95cc Mon Sep 17 00:00:00 2001 From: dan Date: Mon, 20 Jan 2025 02:33:55 +0000 Subject: [PATCH] Fix tabbar swipe conflicting with drawer (#7501) --- src/view/com/pager/TabBar.tsx | 99 ++++++++++++++++++----------------- 1 file changed, 51 insertions(+), 48 deletions(-) diff --git a/src/view/com/pager/TabBar.tsx b/src/view/com/pager/TabBar.tsx index 8e89b9c1f2..49f8ead800 100644 --- a/src/view/com/pager/TabBar.tsx +++ b/src/view/com/pager/TabBar.tsx @@ -13,6 +13,7 @@ import Animated, { } from 'react-native-reanimated' import {PressableWithHover} from '#/view/com/util/PressableWithHover' +import {BlockDrawerGesture} from '#/view/shell/BlockDrawerGesture' import {atoms as a, useTheme} from '#/alf' import {Text} from '#/components/Typography' @@ -297,57 +298,59 @@ export function TabBar({ testID={testID} style={[t.atoms.bg, a.flex_row]} accessibilityRole="tablist"> - { - containerSize.set(e.nativeEvent.layout.width) - }} - onScrollBeginDrag={() => { - // Remember that you've manually messed with the tabbar scroll. - // This will disable auto-adjustment until after next pager swipe or item tap. - syncScrollState.set('unsynced') - }} - onScroll={e => { - scrollX.value = Math.round(e.nativeEvent.contentOffset.x) - }}> - + { - contentSize.set(e.nativeEvent.layout.width) + containerSize.set(e.nativeEvent.layout.width) }} - style={{flexDirection: 'row', flexGrow: 1}}> - {items.map((item, i) => { - return ( - - ) - })} + onScrollBeginDrag={() => { + // Remember that you've manually messed with the tabbar scroll. + // This will disable auto-adjustment until after next pager swipe or item tap. + syncScrollState.set('unsynced') + }} + onScroll={e => { + scrollX.value = Math.round(e.nativeEvent.contentOffset.x) + }}> - - + onLayout={e => { + contentSize.set(e.nativeEvent.layout.width) + }} + style={{flexDirection: 'row', flexGrow: 1}}> + {items.map((item, i) => { + return ( + + ) + })} + + + + )