diff --git a/.changeset/modern-seas-pull.md b/.changeset/modern-seas-pull.md new file mode 100644 index 00000000..bbae0218 --- /dev/null +++ b/.changeset/modern-seas-pull.md @@ -0,0 +1,5 @@ +--- +"react-native-bottom-tabs": patch +--- + +fix(ios): correctly handle active items for scroll edge transparent diff --git a/packages/react-native-bottom-tabs/ios/TabViewImpl.swift b/packages/react-native-bottom-tabs/ios/TabViewImpl.swift index 36300aad..2b739282 100644 --- a/packages/react-native-bottom-tabs/ios/TabViewImpl.swift +++ b/packages/react-native-bottom-tabs/ios/TabViewImpl.swift @@ -195,9 +195,6 @@ private func createFontAttributes( ) -> [NSAttributedString.Key: Any] { var attributes: [NSAttributedString.Key: Any] = [:] - if let inactiveTintColor { - attributes[.foregroundColor] = inactiveTintColor - } if family != nil || weight != nil { attributes[.font] = RCTFont.update( @@ -258,12 +255,16 @@ private func configureStandardAppearance(tabBar: UITabBar, props: TabViewProps) let itemAppearance = UITabBarItemAppearance() let fontSize = props.fontSize != nil ? CGFloat(props.fontSize!) : tabBarDefaultFontSize - let attributes = createFontAttributes( + var attributes = createFontAttributes( size: fontSize, family: props.fontFamily, weight: props.fontWeight, inactiveTintColor: props.inactiveTintColor ) + + if let inactiveTintColor = props.inactiveTintColor { + attributes[.foregroundColor] = inactiveTintColor + } if let inactiveTintColor = props.inactiveTintColor { itemAppearance.normal.iconColor = inactiveTintColor