From 913cffe24e9da5fa6896cbd79d2040127317c857 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 10 Oct 2023 14:36:21 -0500 Subject: [PATCH] ONEAPP-4828 - [Accessibility] Toggle ONEAPP-4684 - [Accessibility] Tooltip Signed-off-by: Matt Bruce --- VDS/Components/Tooltip/Tooltip.swift | 19 +++++++++---------- VDS/Protocols/Clickable.swift | 3 ++- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/VDS/Components/Tooltip/Tooltip.swift b/VDS/Components/Tooltip/Tooltip.swift index c6ae86ba..6e122950 100644 --- a/VDS/Components/Tooltip/Tooltip.swift +++ b/VDS/Components/Tooltip/Tooltip.swift @@ -130,16 +130,15 @@ open class Tooltip: Control, TooltipLaunchable { isAccessibilityElement = true accessibilityTraits = .button - onClickSubscriber = publisher(for: .touchUpInside) - .sink(receiveValue: { [weak self] tooltip in - guard let self else { return} - self.presentTooltip(surface: tooltip.surface, - tooltipModel: .init(closeButtonText: tooltip.closeButtonText, - title: tooltip.title, - content: tooltip.content, - contentView: tooltip.contentView), - presenter: self) - }) + onClick = { [weak self] tooltip in + guard let self else { return} + self.presentTooltip(surface: tooltip.surface, + tooltipModel: .init(closeButtonText: tooltip.closeButtonText, + title: tooltip.title, + content: tooltip.content, + contentView: tooltip.contentView), + presenter: self) + } } /// Resets to default settings. diff --git a/VDS/Protocols/Clickable.swift b/VDS/Protocols/Clickable.swift index b8c49a88..29b66aaf 100644 --- a/VDS/Protocols/Clickable.swift +++ b/VDS/Protocols/Clickable.swift @@ -22,7 +22,8 @@ extension Clickable { set { if let newValue { onClickSubscriber = publisher(for: .touchUpInside) - .sink { c in + .sink { [weak self] c in + guard let self, self.isEnabled else { return } newValue(c) } } else {