ONEAPP-4684 - Acessibility - Tooltip (Header)

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2023-10-27 13:14:36 -05:00
parent 71ef62ebbf
commit 196bc52288
3 changed files with 8 additions and 3 deletions

View File

@ -61,7 +61,7 @@ open class Label: UILabel, ViewProtocol, UserInfoable {
isUserInteractionEnabled = !actions.isEmpty isUserInteractionEnabled = !actions.isEmpty
if actions.isEmpty { if actions.isEmpty {
tapGesture = nil tapGesture = nil
accessibilityTraits = .staticText
} else { } else {
//add tap gesture //add tap gesture
if tapGesture == nil { if tapGesture == nil {
@ -174,6 +174,7 @@ open class Label: UILabel, ViewProtocol, UserInfoable {
lineBreakMode = .byWordWrapping lineBreakMode = .byWordWrapping
translatesAutoresizingMaskIntoConstraints = false translatesAutoresizingMaskIntoConstraints = false
accessibilityCustomActions = [] accessibilityCustomActions = []
isAccessibilityElement = true
accessibilityTraits = .staticText accessibilityTraits = .staticText
textAlignment = .left textAlignment = .left
setup() setup()
@ -304,7 +305,6 @@ open class Label: UILabel, ViewProtocol, UserInfoable {
if let accessibilityElements, !accessibilityElements.isEmpty { if let accessibilityElements, !accessibilityElements.isEmpty {
let staticText = UIAccessibilityElement(accessibilityContainer: self) let staticText = UIAccessibilityElement(accessibilityContainer: self)
staticText.accessibilityLabel = text staticText.accessibilityLabel = text
staticText.accessibilityTraits = .staticText
staticText.accessibilityFrameInContainerSpace = bounds staticText.accessibilityFrameInContainerSpace = bounds
isAccessibilityElement = false isAccessibilityElement = false

View File

@ -58,7 +58,6 @@ open class TooltipDialog: View, UIScrollViewDelegate {
open var titleLabel = Label().with { label in open var titleLabel = Label().with { label in
label.isAccessibilityElement = true label.isAccessibilityElement = true
label.accessibilityTraits = .header
label.textStyle = .boldTitleMedium label.textStyle = .boldTitleMedium
} }
@ -99,6 +98,8 @@ open class TooltipDialog: View, UIScrollViewDelegate {
open override func setup() { open override func setup() {
super.setup() super.setup()
titleLabel.accessibilityTraits = .header
layer.cornerRadius = 8 layer.cornerRadius = 8
contentStackView.addArrangedSubview(titleLabel) contentStackView.addArrangedSubview(titleLabel)
contentStackView.addArrangedSubview(contentLabel) contentStackView.addArrangedSubview(contentLabel)

View File

@ -1,3 +1,7 @@
1.0.47
=======
- ONEAPP-4684 - Acessibility - Tooltip (Header)
1.0.46 1.0.46
======= =======
- ONEAPP-4828 - Accessibility - Toggle - ONEAPP-4828 - Accessibility - Toggle