diff --git a/VDS/Components/BadgeIndicator/BadgeIndicator.swift b/VDS/Components/BadgeIndicator/BadgeIndicator.swift index 45432458..f9d18301 100644 --- a/VDS/Components/BadgeIndicator/BadgeIndicator.swift +++ b/VDS/Components/BadgeIndicator/BadgeIndicator.swift @@ -268,10 +268,10 @@ open class BadgeIndicator: View { /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. open override func setup() { super.setup() - + isAccessibilityElement = true + addSubview(badgeView) badgeView.addSubview(label) - accessibilityElements = [label] heightConstraint = badgeView.heightGreaterThanEqualTo(constant: badgeSize) widthConstraint = badgeView.widthGreaterThanEqualTo(constant: badgeSize) @@ -347,6 +347,15 @@ open class BadgeIndicator: View { layoutIfNeeded() } + open override func updateAccessibility() { + super.updateAccessibility() + if kind == .numbered { + accessibilityLabel = label.text + } else { + accessibilityLabel = "Simple" + } + } + open override func layoutSubviews() { super.layoutSubviews()