Skip to content

Commit 5a519c9

Browse files
authored
fix(ios): correctly handle active items for scroll edge transparent (#166)
* fix(ios): correctly handle active items for scroll edge transparent * Create modern-seas-pull.md
1 parent d7373ac commit 5a519c9

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

.changeset/modern-seas-pull.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+
fix(ios): correctly handle active items for scroll edge transparent

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,6 @@ private func createFontAttributes(
195195
) -> [NSAttributedString.Key: Any] {
196196
var attributes: [NSAttributedString.Key: Any] = [:]
197197

198-
if let inactiveTintColor {
199-
attributes[.foregroundColor] = inactiveTintColor
200-
}
201198

202199
if family != nil || weight != nil {
203200
attributes[.font] = RCTFont.update(
@@ -258,12 +255,16 @@ private func configureStandardAppearance(tabBar: UITabBar, props: TabViewProps)
258255
let itemAppearance = UITabBarItemAppearance()
259256
let fontSize = props.fontSize != nil ? CGFloat(props.fontSize!) : tabBarDefaultFontSize
260257

261-
let attributes = createFontAttributes(
258+
var attributes = createFontAttributes(
262259
size: fontSize,
263260
family: props.fontFamily,
264261
weight: props.fontWeight,
265262
inactiveTintColor: props.inactiveTintColor
266263
)
264+
265+
if let inactiveTintColor = props.inactiveTintColor {
266+
attributes[.foregroundColor] = inactiveTintColor
267+
}
267268

268269
if let inactiveTintColor = props.inactiveTintColor {
269270
itemAppearance.normal.iconColor = inactiveTintColor

0 commit comments

Comments
 (0)