Merge branch 'mbruce/bugfixes' into 'develop'

updated accessibility

See merge request BPHV_MIPS/vds_ios!117
This commit is contained in:
Bruce, Matt R 2023-09-21 19:56:31 +00:00
commit c6b6fbf0cb

View File

@ -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,9 @@ 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()
isAccessibilityElement = true
accessibilityTraits = .staticText
accessibilityElements = [label]
layer.cornerRadius = 2
addSubview(label)
@ -177,4 +179,10 @@ open class Badge: View {
label.surface = surface
label.isEnabled = isEnabled
}
open override func updateAccessibility() {
super.updateAccessibility()
accessibilityLabel = text
}
}