From 196bc522889535b4b2e125f7edadc861a1924a2c Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Fri, 27 Oct 2023 13:14:36 -0500 Subject: [PATCH] ONEAPP-4684 - Acessibility - Tooltip (Header) Signed-off-by: Matt Bruce --- VDS/Components/Label/Label.swift | 4 ++-- VDS/Components/Tooltip/TooltipDialog.swift | 3 ++- VDS/SupportingFiles/ReleaseNotes.txt | 4 ++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/VDS/Components/Label/Label.swift b/VDS/Components/Label/Label.swift index 3aa5f05d..0e804b30 100644 --- a/VDS/Components/Label/Label.swift +++ b/VDS/Components/Label/Label.swift @@ -61,7 +61,7 @@ open class Label: UILabel, ViewProtocol, UserInfoable { isUserInteractionEnabled = !actions.isEmpty if actions.isEmpty { tapGesture = nil - accessibilityTraits = .staticText + } else { //add tap gesture if tapGesture == nil { @@ -174,6 +174,7 @@ open class Label: UILabel, ViewProtocol, UserInfoable { lineBreakMode = .byWordWrapping translatesAutoresizingMaskIntoConstraints = false accessibilityCustomActions = [] + isAccessibilityElement = true accessibilityTraits = .staticText textAlignment = .left setup() @@ -304,7 +305,6 @@ open class Label: UILabel, ViewProtocol, UserInfoable { if let accessibilityElements, !accessibilityElements.isEmpty { let staticText = UIAccessibilityElement(accessibilityContainer: self) staticText.accessibilityLabel = text - staticText.accessibilityTraits = .staticText staticText.accessibilityFrameInContainerSpace = bounds isAccessibilityElement = false diff --git a/VDS/Components/Tooltip/TooltipDialog.swift b/VDS/Components/Tooltip/TooltipDialog.swift index a5db8627..6a50b275 100644 --- a/VDS/Components/Tooltip/TooltipDialog.swift +++ b/VDS/Components/Tooltip/TooltipDialog.swift @@ -58,7 +58,6 @@ open class TooltipDialog: View, UIScrollViewDelegate { open var titleLabel = Label().with { label in label.isAccessibilityElement = true - label.accessibilityTraits = .header label.textStyle = .boldTitleMedium } @@ -99,6 +98,8 @@ open class TooltipDialog: View, UIScrollViewDelegate { open override func setup() { super.setup() + titleLabel.accessibilityTraits = .header + layer.cornerRadius = 8 contentStackView.addArrangedSubview(titleLabel) contentStackView.addArrangedSubview(contentLabel) diff --git a/VDS/SupportingFiles/ReleaseNotes.txt b/VDS/SupportingFiles/ReleaseNotes.txt index 90973c50..d042255b 100644 --- a/VDS/SupportingFiles/ReleaseNotes.txt +++ b/VDS/SupportingFiles/ReleaseNotes.txt @@ -1,3 +1,7 @@ +1.0.47 +======= +- ONEAPP-4684 - Acessibility - Tooltip (Header) + 1.0.46 ======= - ONEAPP-4828 - Accessibility - Toggle