diff --git a/.changeset/hide-tab-bar-identity.md b/.changeset/hide-tab-bar-identity.md new file mode 100644 index 00000000..edc7e65e --- /dev/null +++ b/.changeset/hide-tab-bar-identity.md @@ -0,0 +1,5 @@ +--- +'react-native-bottom-tabs': patch +--- + +Fix toggling `tabBarHidden` on iOS rebuilding the tab content, which dismissed sheets presented from the tab and dropped text input focus diff --git a/packages/react-native-bottom-tabs/ios/TabViewImpl.swift b/packages/react-native-bottom-tabs/ios/TabViewImpl.swift index 6de510d0..ca8ff60a 100644 --- a/packages/react-native-bottom-tabs/ios/TabViewImpl.swift +++ b/packages/react-native-bottom-tabs/ios/TabViewImpl.swift @@ -660,14 +660,10 @@ extension View { @ViewBuilder func hideTabBar(_ flag: Bool) -> some View { #if !os(macOS) - if flag { - if #available(iOS 16.0, tvOS 16.0, *) { - self.toolbar(.hidden, for: .tabBar) - } else { - // We fallback to isHidden on UITabBar - self - } + if #available(iOS 16.0, tvOS 16.0, *) { + self.toolbar(flag ? .hidden : .automatic, for: .tabBar) } else { + // We fallback to isHidden on UITabBar self } #else