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 {