From 90d5d8dc535fb5de6951a8a2b4eb77403b851ce4 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Fri, 12 Jan 2024 21:54:43 +0000 Subject: [PATCH] Fix search positioning --- src/view/screens/Search/Search.tsx | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/src/view/screens/Search/Search.tsx b/src/view/screens/Search/Search.tsx index 6bf19b9d8c..91cfc9d233 100644 --- a/src/view/screens/Search/Search.tsx +++ b/src/view/screens/Search/Search.tsx @@ -332,7 +332,9 @@ export function SearchScreenInner({ tabBarPosition="top" onPageSelected={onPageSelected} renderTabBar={props => ( - + )} @@ -373,7 +375,9 @@ export function SearchScreenInner({ tabBarPosition="top" onPageSelected={onPageSelected} renderTabBar={props => ( - + )} @@ -529,6 +533,7 @@ export function SearchScreen( style={[ styles.header, pal.border, + pal.view, isTabletOrDesktop && {paddingTop: 10}, ]} sideBorders={isTabletOrDesktop}> @@ -652,18 +657,19 @@ function scrollToTopWeb() { } } +const HEADER_HEIGHT = 50 + const styles = StyleSheet.create({ - container: { - // @ts-ignore web only - position: 'sticky', - top: 0, - zIndex: 1, - }, header: { flexDirection: 'row', alignItems: 'center', paddingHorizontal: 12, paddingVertical: 4, + height: HEADER_HEIGHT, + // @ts-ignore web only + position: isWeb ? 'sticky' : '', + top: 0, + zIndex: 1, }, headerMenuBtn: { width: 30, @@ -693,4 +699,10 @@ const styles = StyleSheet.create({ headerCancelBtn: { paddingLeft: 10, }, + tabBarContainer: { + // @ts-ignore web only + position: isWeb ? 'sticky' : '', + top: isWeb ? HEADER_HEIGHT : 0, + zIndex: 1, + }, })