From 05543e7c897e2cf040a71e22f9c30a93569c48fb Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 1 Aug 2023 09:21:16 -0500 Subject: [PATCH] updated trait from text to link when there is a action Signed-off-by: Matt Bruce --- VDS/Components/Label/Label.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/VDS/Components/Label/Label.swift b/VDS/Components/Label/Label.swift index 59358125..733d858b 100644 --- a/VDS/Components/Label/Label.swift +++ b/VDS/Components/Label/Label.swift @@ -223,6 +223,7 @@ open class Label: UILabel, Handlerable, ViewProtocol, Resettable, UserInfoable { private var actions: [LabelAction] = [] { didSet { isUserInteractionEnabled = !actions.isEmpty + accessibilityTraits = !actions.isEmpty ? .link : .staticText if actions.isEmpty { tapGesture = nil } else { @@ -265,7 +266,6 @@ open class Label: UILabel, Handlerable, ViewProtocol, Resettable, UserInfoable { let actionText = accessibleText ?? NSString(string:text).substring(with: range) let accessibleAction = UIAccessibilityCustomAction(name: actionText, target: self, selector: #selector(accessibilityCustomAction(_:))) accessibilityCustomActions?.append(accessibleAction) - return accessibleAction } @@ -295,4 +295,3 @@ open class Label: UILabel, Handlerable, ViewProtocol, Resettable, UserInfoable { return false } } -