Skip to content

Commit 4e579a2

Browse files
fix(mobile): the Settings tab selects natively instead of being prevented and re-selected
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 120d79e commit 4e579a2

1 file changed

Lines changed: 1 addition & 13 deletions

File tree

‎apps/mobile/src/features/workspace/WorkspaceNativeTabs.ios.tsx‎

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,7 @@ import {
55
} from "./navigation-tabs";
66
import { useCallback, useMemo, useState, type ReactNode } from "react";
77
import { View, useWindowDimensions, type NativeSyntheticEvent } from "react-native";
8-
import {
9-
Tabs,
10-
type TabSelectedEvent,
11-
type TabSelectionPreventedEvent,
12-
type TabSelectionRejectedEvent,
13-
} from "react-native-screens";
8+
import { Tabs, type TabSelectedEvent, type TabSelectionRejectedEvent } from "react-native-screens";
149

1510
import { WorkspaceTabsContext, useWorkspaceTabs } from "./WorkspaceTabsContext";
1611
import {
@@ -94,11 +89,6 @@ export function WorkspaceNativeTabs(props: {
9489
tabBarMinimizeBehavior: "never",
9590
tabBarTintColor: colors["--color-primary"],
9691
}}
97-
onTabSelectionPrevented={({
98-
nativeEvent,
99-
}: NativeSyntheticEvent<TabSelectionPreventedEvent>) => {
100-
if (nativeEvent.preventedScreenKey === "settings") selectTab("settings");
101-
}}
10292
onTabSelectionRejected={({
10393
nativeEvent,
10494
}: NativeSyntheticEvent<TabSelectionRejectedEvent>) =>
@@ -108,7 +98,6 @@ export function WorkspaceNativeTabs(props: {
10898
setProvenance(nativeEvent.provenance);
10999
if (nativeEvent.actionOrigin === "programmatic-js") return;
110100
const tab = workspaceTabForNativeSlot(primaryTabs, nativeEvent.selectedScreenKey);
111-
// UIKit sends reselects here even when preventNativeSelection is enabled.
112101
if (tab) selectTab(tab);
113102
}}
114103
>
@@ -123,7 +112,6 @@ export function WorkspaceNativeTabs(props: {
123112
screenKey={slot}
124113
title=""
125114
tabBarItemAccessibilityLabel={settings ? "Settings" : WORKSPACE_TAB_LABELS[tab]}
126-
preventNativeSelection={settings}
127115
ios={{
128116
icon: settings
129117
? { type: "sfSymbol", name: "gearshape" }

0 commit comments

Comments
 (0)