Merge branch 'mbruce/bugfixes' into 'develop'
updated accessibility See merge request BPHV_MIPS/vds_ios!117
This commit is contained in:
commit
c6b6fbf0cb
@ -47,6 +47,7 @@ open class Badge: View {
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
/// Label used to render text
|
/// Label used to render text
|
||||||
open var label = Label().with {
|
open var label = Label().with {
|
||||||
|
$0.isAccessibilityElement = false
|
||||||
$0.lineBreakMode = .byTruncatingTail
|
$0.lineBreakMode = .byTruncatingTail
|
||||||
$0.setContentCompressionResistancePriority(.required, for: .vertical)
|
$0.setContentCompressionResistancePriority(.required, for: .vertical)
|
||||||
$0.setContentHuggingPriority(.defaultHigh, 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.
|
/// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations.
|
||||||
open override func setup() {
|
open override func setup() {
|
||||||
super.setup()
|
super.setup()
|
||||||
|
isAccessibilityElement = true
|
||||||
|
accessibilityTraits = .staticText
|
||||||
|
|
||||||
accessibilityElements = [label]
|
|
||||||
layer.cornerRadius = 2
|
layer.cornerRadius = 2
|
||||||
|
|
||||||
addSubview(label)
|
addSubview(label)
|
||||||
@ -177,4 +179,10 @@ open class Badge: View {
|
|||||||
label.surface = surface
|
label.surface = surface
|
||||||
label.isEnabled = isEnabled
|
label.isEnabled = isEnabled
|
||||||
}
|
}
|
||||||
|
|
||||||
|
open override func updateAccessibility() {
|
||||||
|
super.updateAccessibility()
|
||||||
|
|
||||||
|
accessibilityLabel = text
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user