From 880245d94e6fd2fcb149f19fc8f6f01f8750ac27 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Thu, 28 Mar 2024 09:23:06 -0500 Subject: [PATCH] updated accessibility for ButtonIcon Signed-off-by: Matt Bruce --- VDS/Components/Icon/ButtonIcon/ButtonIcon.swift | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/VDS/Components/Icon/ButtonIcon/ButtonIcon.swift b/VDS/Components/Icon/ButtonIcon/ButtonIcon.swift index 65968214..738881e3 100644 --- a/VDS/Components/Icon/ButtonIcon/ButtonIcon.swift +++ b/VDS/Components/Icon/ButtonIcon/ButtonIcon.swift @@ -108,7 +108,10 @@ open class ButtonIcon: Control, Changeable, FormFieldable { open var badgeIndicatorModel: BadgeIndicatorModel? { didSet { setNeedsUpdate() } } /// Icon object used to render out the Icon for this ButtonIcon. - open var icon = Icon().with { $0.isUserInteractionEnabled = false } + open var icon = Icon().with { + $0.isUserInteractionEnabled = false + $0.accessibilityTraits = .button + } /// Determines the type of button based on the contrast. open var kind: Kind = .ghost { didSet { setNeedsUpdate() } } @@ -342,9 +345,8 @@ open class ButtonIcon: Control, Changeable, FormFieldable { /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. open override func setup() { super.setup() - isAccessibilityElement = true - accessibilityTraits = .button - accessibilityElements = [badgeIndicator] + isAccessibilityElement = false + accessibilityElements = [icon, badgeIndicator] //create a layoutGuide for the icon to key off of let iconLayoutGuide = UILayoutGuide()