Skip to content

Commit

Permalink
Add disabled trait to tab bar item view (#2079)
Browse files Browse the repository at this point in the history
* add tab bar item disabled trait

* check if isEnabled changed
  • Loading branch information
joannaquu authored Jul 30, 2024
1 parent 6360f50 commit 224dab9
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions ios/FluentUI/Tab Bar/TabBarItemView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,15 @@ class TabBarItemView: UIControl, TokenizedControlInternal {

override var isEnabled: Bool {
didSet {
isUserInteractionEnabled = isEnabled
updateColors()
if isEnabled != oldValue {
isUserInteractionEnabled = isEnabled
if isEnabled {
accessibilityTraits.remove(.notEnabled)
} else {
accessibilityTraits.insert(.notEnabled)
}
updateColors()
}
}
}

Expand Down

0 comments on commit 224dab9

Please # to comment.