Skip to content

Commit

Permalink
fix: hide routes with opacity 0 for Android (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
okwasniewski authored Nov 8, 2024
1 parent 2648047 commit 3d4db5f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/TabView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ const TabView = <Route extends BaseRoute>({
}

const focused = route.key === focusedKey;
const opacity = focused ? 1 : 0;
const zIndex = focused ? 0 : -1;

return (
Expand All @@ -282,7 +283,7 @@ const TabView = <Route extends BaseRoute>({
importantForAccessibility={focused ? 'auto' : 'no-hide-descendants'}
style={
Platform.OS === 'android'
? [StyleSheet.absoluteFill, { zIndex }]
? [StyleSheet.absoluteFill, { zIndex, opacity }]
: styles.fullWidth
}
>
Expand Down

0 comments on commit 3d4db5f

Please sign in to comment.