Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/components/BlockingViews/ForceFullScreenView/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {useRoute} from '@react-navigation/native';
import {useIsFocused, useRoute} from '@react-navigation/native';
import React, {useEffect} from 'react';
import {View} from 'react-native';
import {useFullScreenBlockingViewActions} from '@components/FullScreenBlockingViewContextProvider';
Expand All @@ -9,16 +9,17 @@ function ForceFullScreenView({children, shouldForceFullScreen = false}: ForceFul
const route = useRoute();
const styles = useThemeStyles();
const {addRouteKey, removeRouteKey} = useFullScreenBlockingViewActions();
const isFocused = useIsFocused();

useEffect(() => {
if (!shouldForceFullScreen) {
if (!shouldForceFullScreen || !isFocused) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve blocking state under transparent RHP

When a fullscreen route is visible underneath the right modal/RHP, the route is blurred, so useIsFocused() is false even though its fixed forcedBlockingViewContainer is still rendered behind the transparent modal. In that state this guard removes or skips the route key, which makes TabNavigatorBar apply its zIndex: 1 again and lets the navigation tab bar bleed over the blocking view until the RHP closes. Please avoid gating the blocking key solely on focus; it needs to remain set for visible routes under transparent modals and only be pruned when the route is no longer on the visible stack.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ForceFullScreenView keeps rendering its opaque full-screen forcedBlockingViewContainer regardless of focus — the focus guard only controls the isBlockingViewVisible flag that coordinates the NavigationTabBar. Since the tab bar belongs to the focused route, when the blocking screen is blurred it's correct to release the key and let the focused screen own the tab bar; on re-focus the effect re-registers it and the tab bar hides again. So gating on focus is intentional here and behaves correctly.

return;
}

addRouteKey(route.key);

return () => removeRouteKey(route.key);
}, [addRouteKey, removeRouteKey, route.key, shouldForceFullScreen]);
}, [addRouteKey, removeRouteKey, route.key, shouldForceFullScreen, isFocused]);

if (shouldForceFullScreen) {
return <View style={styles.forcedBlockingViewContainer}>{children}</View>;
Expand Down
Loading