Skip to content

Commit 905fdcd

Browse files
committed
Merge branch 'main' into fix/icon-inactive-tint-color
2 parents d19ff06 + 2a8a9a0 commit 905fdcd

7 files changed

Lines changed: 56 additions & 56 deletions

File tree

.changeset/grumpy-otters-report.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'react-native-bottom-tabs': patch
3+
---
4+
5+
Disable tabBarInactiveTintColor on iOS >= 26

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
#
33
.DS_Store
44

5-
# XDE
6-
.expo/
7-
85
# VSCode
96
.vscode/
107
jsconfig.json
@@ -82,3 +79,6 @@ lib/
8279
# React Native Codegen
8380
ios/generated
8481
android/generated
82+
83+
# Codex
84+
.codex

docs/docs/docs/guides/standalone-usage.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -184,16 +184,8 @@ Color for inactive tabs.
184184

185185
- Type: `ColorValue`
186186

187-
:::warning
188-
On iOS 26 (Liquid Glass), enable `experimental_bakedTintColors` to apply a workaround that bakes tab labels into images for correct tinting. This disables Dynamic Type (accessibility font sizes) and the Bold Text accessibility setting for tab labels.
189-
:::
190-
191-
#### `experimental_bakedTintColors` <Badge text="iOS" type="info" /> <Badge text="experimental" type="danger"/>
192-
193-
Enables the iOS 26 Liquid Glass workaround for active and inactive tint colors. When enabled with custom active or inactive tint colors, tab labels are baked into images so the icon and label receive the same tint during normal selection and Liquid Glass tab scrubbing.
194-
195-
:::warning
196-
This disables Dynamic Type (accessibility font sizes) and the Bold Text accessibility setting for tab labels, and icon sizing can vary with label width.
187+
:::note
188+
On iOS >= 26 (Liquid Glass), this prop is ignored.
197189
:::
198190

199191
#### `tabBarStyle`

docs/docs/docs/guides/usage-with-react-navigation.mdx

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -132,16 +132,8 @@ On iOS 26 (Liquid Glass), enable `experimental_bakedTintColors` to apply a worka
132132

133133
Color for the inactive tabs.
134134

135-
:::warning
136-
On iOS 26 (Liquid Glass), enable `experimental_bakedTintColors` to apply a workaround that bakes tab labels into images for correct tinting. This disables Dynamic Type (accessibility font sizes) and the Bold Text accessibility setting for tab labels.
137-
:::
138-
139-
#### `experimental_bakedTintColors` <Badge text="iOS" type="info" /> <Badge text="experimental" type="danger"/>
140-
141-
Enables the iOS 26 Liquid Glass workaround for active and inactive tint colors. When enabled with custom active or inactive tint colors, tab labels are baked into images so the icon and label receive the same tint during normal selection and Liquid Glass tab scrubbing.
142-
143-
:::warning
144-
This disables Dynamic Type (accessibility font sizes) and the Bold Text accessibility setting for tab labels, and icon sizing can vary with label width.
135+
:::note
136+
On iOS >= 26 (Liquid Glass), this prop is ignored.
145137
:::
146138

147139
#### `tabBarStyle`
@@ -261,7 +253,7 @@ On iOS 26 (Liquid Glass), enable `experimental_bakedTintColors` to apply a worka
261253
:::
262254

263255
:::note
264-
The `tabBarInactiveTintColor` is not supported on route level due to native limitations. Use `inactiveTintColor` in the `Tab.Navigator` instead.
256+
The `tabBarInactiveTintColor` is not supported on route level due to native limitations. Use `tabBarInactiveTintColor` in the `Tab.Navigator` instead.
265257
:::
266258

267259
#### `tabBarIcon`
@@ -332,7 +324,7 @@ To display a badge without text (just a dot), you need to pass a string with a s
332324
#### `tabBarBadgeBackgroundColor`
333325

334326
- Type: `string`
335-
327+
336328
Set the background color for the badge on android.
337329
Uses the system color by default.
338330

@@ -415,7 +407,7 @@ React.useEffect(() => {
415407
const unsubscribe = navigation.addListener('tabPress', (e) => {
416408
// Note: For iOS 26+, use the `preventsDefault` option instead of `e.preventDefault()`
417409
// to avoid animation delays
418-
410+
419411
// Do something manually
420412
// ...
421413
});

packages/react-native-bottom-tabs/ios/TabViewImpl.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ struct TabViewImpl: View {
148148
#if !os(visionOS)
149149
tabBar.isTranslucent = props.translucent
150150
#endif
151-
tabBar.unselectedItemTintColor = props.inactiveTintColor
151+
tabBar.unselectedItemTintColor = props.effectiveInactiveTintColor
152152

153153
guard let items = tabBar.items else { return }
154154

@@ -193,10 +193,10 @@ struct TabViewImpl: View {
193193
fontSize: props.fontSize,
194194
fontFamily: props.fontFamily,
195195
fontWeight: props.fontWeight,
196-
inactiveColor: props.inactiveTintColor
196+
inactiveColor: props.effectiveInactiveTintColor
197197
)
198198

199-
if let inactiveTintColor = props.inactiveTintColor {
199+
if let inactiveTintColor = props.effectiveInactiveTintColor {
200200
itemAppearance.normal.iconColor = inactiveTintColor
201201
}
202202
if let activeTintColor = props.selectedActiveTintColor {

packages/react-native-bottom-tabs/ios/TabViewProps.swift

Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import Foundation
12
import SwiftUI
23

34
internal enum MinimizeBehavior: String {
@@ -6,25 +7,25 @@ internal enum MinimizeBehavior: String {
67
case onScrollUp
78
case onScrollDown
89

9-
#if compiler(>=6.2)
10-
@available(iOS 26.0, macOS 26.0, tvOS 26.0, *)
11-
func convert() -> TabBarMinimizeBehavior {
12-
#if os(macOS) || os(tvOS)
13-
return .automatic
14-
#else
15-
switch self {
16-
case .automatic:
17-
return .automatic
18-
case .never:
19-
return .never
20-
case .onScrollUp:
21-
return .onScrollUp
22-
case .onScrollDown:
23-
return .onScrollDown
10+
#if compiler(>=6.2)
11+
@available(iOS 26.0, macOS 26.0, tvOS 26.0, *)
12+
func convert() -> TabBarMinimizeBehavior {
13+
#if os(macOS) || os(tvOS)
14+
return .automatic
15+
#else
16+
switch self {
17+
case .automatic:
18+
return .automatic
19+
case .never:
20+
return .never
21+
case .onScrollUp:
22+
return .onScrollUp
23+
case .onScrollDown:
24+
return .onScrollDown
25+
}
26+
#endif
2427
}
25-
#endif
26-
}
27-
#endif
28+
#endif
2829
}
2930

3031
public enum TabBarRole: String {
@@ -33,8 +34,8 @@ public enum TabBarRole: String {
3334
@available(iOS 18, macOS 15, visionOS 2, tvOS 18, *)
3435
func convert() -> TabRole {
3536
switch self {
36-
case .search:
37-
return .search
37+
case .search:
38+
return .search
3839
}
3940
}
4041
}
@@ -48,9 +49,7 @@ struct IdentifiablePlatformView: Identifiable, Equatable {
4849
}
4950
}
5051

51-
/**
52-
Props that component accepts. SwiftUI view gets re-rendered when ObservableObject changes.
53-
*/
52+
/// Props that component accepts. SwiftUI view gets re-rendered when ObservableObject changes.
5453
class TabViewProps: ObservableObject {
5554
@Published var children: [IdentifiablePlatformView] = []
5655
@Published var items: [TabInfo] = []
@@ -76,8 +75,9 @@ class TabViewProps: ObservableObject {
7675

7776
var selectedActiveTintColor: PlatformColor? {
7877
if let selectedPage,
79-
let tabData = items.findByKey(selectedPage),
80-
let activeTintColor = tabData.activeTintColor {
78+
let tabData = items.findByKey(selectedPage),
79+
let activeTintColor = tabData.activeTintColor
80+
{
8181
return activeTintColor
8282
}
8383

@@ -86,8 +86,18 @@ class TabViewProps: ObservableObject {
8686

8787
var hasCustomTintColors: Bool {
8888
activeTintColor != nil
89-
|| inactiveTintColor != nil
90-
|| items.contains(where: { $0.activeTintColor != nil })
89+
|| inactiveTintColor != nil
90+
|| items.contains(where: { $0.activeTintColor != nil })
91+
}
92+
93+
var effectiveInactiveTintColor: PlatformColor? {
94+
#if os(iOS)
95+
if ProcessInfo.processInfo.operatingSystemVersion.majorVersion >= 26 {
96+
return nil
97+
}
98+
#endif
99+
100+
return inactiveTintColor
91101
}
92102

93103
var filteredItems: [TabInfo] {

packages/react-native-bottom-tabs/src/TabView.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ interface Props<Route extends BaseRoute> {
7777
tabBarActiveTintColor?: ColorValue;
7878
/**
7979
* Inactive tab color.
80+
* Has no effect on iOS 26 and above (Liquid Glass).
8081
*/
8182
tabBarInactiveTintColor?: ColorValue;
8283
/**

0 commit comments

Comments
 (0)