updated accessibility elements
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
788fcb73ac
commit
90ec2fa8f2
@ -299,9 +299,6 @@ open class Tilelet: TileContainerBase<Tilelet.Padding> {
|
||||
color = .black
|
||||
addContentView(stackView)
|
||||
|
||||
accessibilityTraits = .link
|
||||
accessibilityElements = [badge, titleLockup, descriptiveIcon, directionalIcon]
|
||||
|
||||
//badge
|
||||
badgeContainerView.addSubview(badge)
|
||||
badge
|
||||
@ -412,6 +409,20 @@ open class Tilelet: TileContainerBase<Tilelet.Padding> {
|
||||
/// Used to update any Accessibility properties.
|
||||
open override func updateAccessibility() {
|
||||
super.updateAccessibility()
|
||||
var elements = [Any]()
|
||||
if badgeModel != nil {
|
||||
elements.append(badge)
|
||||
}
|
||||
if titleModel != nil || subTitleModel != nil || eyebrowModel != nil {
|
||||
elements.append(titleLockup)
|
||||
}
|
||||
if descriptiveIconModel != nil {
|
||||
elements.append(descriptiveIcon)
|
||||
}
|
||||
if directionalIconModel != nil {
|
||||
elements.append(directionalIcon)
|
||||
}
|
||||
accessibilityElements = elements.count > 0 ? elements : nil
|
||||
|
||||
setAccessibilityLabel(for: [badge.label, titleLockup.eyebrowLabel, titleLockup.titleLabel, titleLockup.subTitleLabel])
|
||||
}
|
||||
|
||||
@ -272,7 +272,21 @@ open class TitleLockup: View {
|
||||
|
||||
titleLabel.textColorConfiguration = textColorPrimaryConfiguration
|
||||
|
||||
accessibilityElements = [eyebrowLabel, titleLabel, subTitleLabel]
|
||||
}
|
||||
|
||||
open override func updateAccessibility() {
|
||||
super.updateAccessibility()
|
||||
var elements = [Any]()
|
||||
if eyebrowModel != nil {
|
||||
elements.append(eyebrowLabel)
|
||||
}
|
||||
if titleModel != nil {
|
||||
elements.append(titleLabel)
|
||||
}
|
||||
if subTitleModel != nil {
|
||||
elements.append(subTitleLabel)
|
||||
}
|
||||
accessibilityElements = elements.count > 0 ? elements : nil
|
||||
}
|
||||
|
||||
/// Resets to default settings.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user