Digital ACT-191 ONEAPP-6827 story: updated accessibility properties
This commit is contained in:
parent
3df155bff5
commit
3d971fa569
@ -64,8 +64,7 @@ open class BreadcrumbItem: ButtonBase {
|
|||||||
open override func setup() {
|
open override func setup() {
|
||||||
super.setup()
|
super.setup()
|
||||||
isAccessibilityElement = true
|
isAccessibilityElement = true
|
||||||
accessibilityTraits = .button
|
accessibilityTraits = .link
|
||||||
accessibilityLabel = "Breadcrumb"
|
|
||||||
contentHorizontalAlignment = .leading
|
contentHorizontalAlignment = .leading
|
||||||
titleLabel?.numberOfLines = 0
|
titleLabel?.numberOfLines = 0
|
||||||
titleLabel?.lineBreakMode = .byWordWrapping
|
titleLabel?.lineBreakMode = .byWordWrapping
|
||||||
@ -89,4 +88,15 @@ open class BreadcrumbItem: ButtonBase {
|
|||||||
shouldUpdateView = true
|
shouldUpdateView = true
|
||||||
setNeedsUpdate()
|
setNeedsUpdate()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Used to update any Accessibility properties.
|
||||||
|
open override func updateAccessibility() {
|
||||||
|
accessibilityLabel = "Breadcrumb \(text ?? "")"
|
||||||
|
if isEnabled {
|
||||||
|
accessibilityTraits.remove(.notEnabled)
|
||||||
|
} else {
|
||||||
|
accessibilityTraits.insert(.notEnabled)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user