diff --git a/VDS/Components/Badge/Badge.swift b/VDS/Components/Badge/Badge.swift index 67bbae67..f4a9c99c 100644 --- a/VDS/Components/Badge/Badge.swift +++ b/VDS/Components/Badge/Badge.swift @@ -47,6 +47,7 @@ open class Badge: View { //-------------------------------------------------- /// Label used to render text open var label = Label().with { + $0.isAccessibilityElement = false $0.lineBreakMode = .byTruncatingTail $0.setContentCompressionResistancePriority(.required, for: .vertical) $0.setContentHuggingPriority(.defaultHigh, for: .vertical) @@ -131,8 +132,7 @@ open class Badge: 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() - - accessibilityElements = [label] + isAccessibilityElement = true layer.cornerRadius = 2 addSubview(label) @@ -177,4 +177,10 @@ open class Badge: View { label.surface = surface label.isEnabled = isEnabled } + + open override func updateAccessibility() { + super.updateAccessibility() + + accessibilityLabel = text + } }