iOS 27 SDK: tab titles and icons land on the wrong tabs when one tab has role "search"
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 72/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- ios, react-native, swift, typescript
- 領域
- mobile
研究方向
Start in ios/TabViewImpl.swift, at configureTabBarItemImages, and compare the tab bar item's display order with the declared tab order under the iOS 27 SDK. The issue suggests matching items by identity and falling back to position when tabs are unavailable. Reproduce with four tabs, with Search second and role search; done when labels, icons, and selected screens correspond on iOS 27 while the existing fallback remains.
由索引模型根據 Issue 內容生成。
描述
Before submitting a new issue
- I tested using the latest version of the library, as the bug might be already fixed.
- I tested using a supported version of react native.
- I checked for possible duplicate issues, with possible answers.
Bug summary
When the app is built with Xcode 27 (iOS 27 SDK), every tab after a tab with role: "search" shows the title and icon of its neighbour. Selection still works by index, so the bar looks plausible, but pressing a tab opens a different screen than its label says. The same source built with Xcode 26 is fine.
In my case with four tabs declared as Home, Search (role: "search"), Favorites, Library, the bar shows Home, Favorites, Library, Search. Pressing "Library" opens Search and pressing "Search" opens Favorites.
Cause
Linked against the iOS 27 SDK, UITabBar.items is returned in display order, and a tab with the search role is displayed last. UITabBarController.tabs keeps the declaration order.
configureTabBarItemImages in ios/TabViewImpl.swift assigns title and image by the item's position:
for (tabBarIndex, item) in items.enumerated() {
guard let tabData = props.filteredItems[safe: tabBarIndex] else { continue }
So the item at display position 1 (Favorites) receives the data of declared tab 1 (Search), and so on. This is still the case on main (b044dbd5).
Suggested fix
Match the item to its tab by identity instead of by position, and fall back to the position where tabs is not available:
private func declarationIndex(of item: UITabBarItem, at tabBarIndex: Int, in tabBar: UITabBar) -> Int {
if #available(iOS 18.0, tvOS 18.0, visionOS 2.0, *),
let tabController = tabBar.delegate as? UITabBarController,
let index = tabController.tabs.firstIndex(where: { $0.viewController?.tabBarItem === item })
{
return index
}
return tabBarIndex
}
We run this as a patch on 1.4.0 and it restores the right labels: https://github.com/streamyfin/streamyfin/pull/2196. Happy to open a PR here.
Related: #590 and #588 touch the same function.
Library version
1.4.0
Environment info
System:
OS: macOS 26.6.2
CPU: (11) arm64 Apple M3 Pro
SDKs:
iOS SDK:
Platforms:
- iOS 27.0
- tvOS 27.0
IDEs:
Xcode:
version: 27.0/27A266a
Languages:
Swift: 6.4
npmPackages:
react:
installed: 19.2.3
react-native-tvos:
installed: 0.86.0-2
react-native-bottom-tabs: 1.4.0
"@bottom-tabs/react-navigation": 1.4.0
"@react-navigation/native": 7.3.17
expo: 57.0.25
iOS:
hermesEnabled: true
newArchEnabled: true
Steps to reproduce
iOS only. Seen on a physical iPhone 17 Pro and on the iOS 27.0 simulator (iPhone 18 Pro).
- Declare four tabs, the second one with
role: "search"(sample below). - Build and run with Xcode 27.0 (iOS 27 SDK).
- Look at the tab bar: it reads Home, Favorites, Library, Search.
- Press "Library": the Search screen opens. Press "Search": the Favorites screen opens.
- Build the same source with Xcode 26: labels and screens match.
Reproducible sample code
// Mirrors the tab setup in our app (https://github.com/streamyfin/streamyfin).
// Not run standalone: the bug was observed in the app itself.
import * as React from 'react';
import { Text, View } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeBottomTabNavigator } from '@bottom-tabs/react-navigation';
const Tab = createNativeBottomTabNavigator();
const screen = (label) => () => (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<Text>{label}</Text>
</View>
);
const Home = screen('Home screen');
const Search = screen('Search screen');
const Favorites = screen('Favorites screen');
const Library = screen('Library screen');
export default function App() {
return (
<NavigationContainer>
<Tab.Navigator>
<Tab.Screen
name="Home"
component={Home}
options={{ tabBarIcon: () => ({ sfSymbol: 'house.fill' }) }}
/>
<Tab.Screen
name="Search"
component={Search}
options={{
role: 'search',
tabBarIcon: () => ({ sfSymbol: 'magnifyingglass' }),
}}
/>
<Tab.Screen
name="Favorites"
component={Favorites}
options={{ tabBarIcon: () => ({ sfSymbol: 'heart.fill' }) }}
/>
<Tab.Screen
name="Library"
component={Library}
options={{ tabBarIcon: () => ({ sfSymbol: 'rectangle.stack.fill' }) }}
/>
</Tab.Navigator>
</NavigationContainer>
);
}
- 主要語言
- TypeScript
- 星號
- 1.5k
- 分支
- 111
- 平均合併
- 2 天 1 小時
- 30 天內合併 PR
- 6
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
callstack/react-native-bottom-tabs 的其他 Issue
-
bug
難度 1/5 1 小時以內 新手友好度 92/100
callstack/react-native-bottom-tabs#607 ·
維護者通常 1 天內回覆
-
[iOS] Fabric: SIGABRT on tab press when tab key contains non-ASCII characters (kCFStringEncodingUTF8 passed to -cStringUsingEncoding:)可能已有人在做 @thiagobrez 於 64 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 75/100
callstack/react-native-bottom-tabs#560 ·
維護者通常 1 天內回覆
-
[iOS] Tabs don't fire tabLongPress event on iOS 26可能已有人在做 @thiagobrez 於 39 天前認領。 未關閉bug
難度 4/5 3-5 天 新手友好度 48/100
callstack/react-native-bottom-tabs#573 ·
維護者通常 1 天內回覆
-
iOS: allow opting out of the private-CoreSVG SVG decoder (exclude_files by default, or an opt-in flag)可能已有人在做 @oleksandrzavarzin-callstack 於 6 天前認領。 未關閉
難度 3/5 1-2 天 新手友好度 68/100
callstack/react-native-bottom-tabs#565 ·
維護者通常 1 天內回覆
-
Tab icon size is hard-coded to 27x27pt with no way to override it可能已有人在做 @thiagobrez 於 65 天前認領。 未關閉
難度 4/5 3-5 天 新手友好度 48/100
callstack/react-native-bottom-tabs#561 · 1 則留言 · 2 個 reaction ·
維護者通常 1 天內回覆
查看 callstack/react-native-bottom-tabs 的全部 Issue
相似的 Issue
-
難度 1/5 1-3 小時 新手友好度 66/100
維護者通常 1 天內回覆
-
area:plugins area:security area:skills bug has repro
難度 2/5 1-3 小時 新手友好度 76/100
anthropics/claude-code#105911 ·
維護者通常 1 天內回覆
-
documentation good first issue help wanted
難度 2/5 1-3 小時 新手友好度 74/100
dev-five-git/devup-ui#879 ·
維護者通常 11 天內回覆
-
openspec-apply-change skill: when blocked, may select a ready artifact unrelated to missingArtifacts未關閉
難度 2/5 1-3 小時 新手友好度 72/100
Fission-AI/OpenSpec#2165 ·
維護者通常 1 天內回覆
-
🐞 bug 🧐 unconfirmed
難度 2/5 1-3 小時 新手友好度 66/100
Tencent/tdesign-vue-next#7032 · 1 則留言 ·
維護者通常 1 天內回覆