Skip to content

Commit

Permalink
fix(ios): correctly handle active items for scroll edge transparent (#…
Browse files Browse the repository at this point in the history
…166)

* fix(ios): correctly handle active items for scroll edge transparent

* Create modern-seas-pull.md
  • Loading branch information
okwasniewski authored Nov 28, 2024
1 parent d7373ac commit 5a519c9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/modern-seas-pull.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"react-native-bottom-tabs": patch
---

fix(ios): correctly handle active items for scroll edge transparent
9 changes: 5 additions & 4 deletions packages/react-native-bottom-tabs/ios/TabViewImpl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5a519c9

Please sign in to comment.