Skip to content

Commit

Permalink
Fix z-indexes to make tabbar scroll on Android (#7102)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon authored Dec 14, 2024
1 parent ca8ca90 commit 55222c5
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/screens/Hashtag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export default function HashtagScreen({
<Pager
onPageSelected={onPageSelected}
renderTabBar={props => (
<Layout.Center style={web([a.sticky, a.z_10, {top: 0}])}>
<Layout.Center style={[a.z_10, web([a.sticky, {top: 0}])]}>
<TabBar items={sections.map(section => section.title)} {...props} />
</Layout.Center>
)}
Expand Down
14 changes: 6 additions & 8 deletions src/view/com/pager/Pager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,12 @@ export const Pager = forwardRef<PagerRef, React.PropsWithChildren<Props>>(

return (
<View testID={testID} style={[a.flex_1, native(a.overflow_hidden)]}>
<View style={a.z_10 /* Let tabbar bottom border cover the glimmer */}>
{renderTabBar({
selectedPage,
onSelect: onTabBarSelect,
dragProgress,
dragState,
})}
</View>
{renderTabBar({
selectedPage,
onSelect: onTabBarSelect,
dragProgress,
dragState,
})}
<GestureDetector gesture={nativeGesture}>
<AnimatedPagerView
ref={pagerView}
Expand Down
16 changes: 9 additions & 7 deletions src/view/com/pager/PagerWithHeader.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,16 @@ let PagerTabBar = ({
<Layout.Center>{renderHeader?.({setMinimumHeight: noop})}</Layout.Center>
{tabBarAnchor}
<Layout.Center
style={web([
a.sticky,
style={[
a.z_10,
{
top: 0,
display: isHeaderReady ? undefined : 'none',
},
])}>
web([
a.sticky,
{
top: 0,
display: isHeaderReady ? undefined : 'none',
},
]),
]}>
<TabBar
testID={testID}
items={items}
Expand Down
2 changes: 1 addition & 1 deletion src/view/screens/Notifications.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export function NotificationsScreen({}: Props) {
<Pager
onPageSelected={onPageSelected}
renderTabBar={props => (
<Layout.Center style={web([a.sticky, a.z_10, {top: 0}])}>
<Layout.Center style={[a.z_10, web([a.sticky, {top: 0}])]}>
<TabBar
{...props}
items={sections.map(section => section.title)}
Expand Down
3 changes: 2 additions & 1 deletion src/view/screens/Search/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,8 @@ let SearchScreenInner = ({
renderTabBar={props => (
<Layout.Center
style={[
web([a.sticky, a.z_10]),
a.z_10,
web([a.sticky]),
{top: isWeb ? headerHeight : undefined},
]}>
<TabBar items={sections.map(section => section.title)} {...props} />
Expand Down

0 comments on commit 55222c5

Please sign in to comment.