From 816ee9f0aa5f75f4d7efeeb4f021b0231ac14139 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 8 Aug 2023 13:06:57 -0500 Subject: [PATCH] updated tooltip info for accessibility Signed-off-by: Matt Bruce --- VDS/Components/Tooltip/Tooltip.swift | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/VDS/Components/Tooltip/Tooltip.swift b/VDS/Components/Tooltip/Tooltip.swift index f983cfb7..c522137f 100644 --- a/VDS/Components/Tooltip/Tooltip.swift +++ b/VDS/Components/Tooltip/Tooltip.swift @@ -175,11 +175,13 @@ open class Tooltip: Control, TooltipLaunchable { if label == nil { label = content } + if let label, !label.isEmpty { + accessibilityLabel = label + } else { + accessibilityLabel = "Tooltip" + } accessibilityHint = isEnabled ? "Click to open Tooltip." : "" accessibilityValue = "collapsed" - if let label { - accessibilityLabel = label - } } public static func accessibleText(for title: String?, content: String?, closeButtonText: String) -> String {