Skip to content

Commit 7fc759c

Browse files
fix: do not execute action if the touch was cancelled
1 parent 9dc0739 commit 7fc759c

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

Sources/ComponentsKit/Button/UKButton.swift

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,13 +157,7 @@ open class UKButton: UIView, UKComponent {
157157
) {
158158
super.touchesCancelled(touches, with: event)
159159

160-
defer { self.isPressed = false }
161-
162-
if self.model.isEnabled,
163-
let location = touches.first?.location(in: self),
164-
self.bounds.contains(location) {
165-
self.action()
166-
}
160+
self.isPressed = false
167161
}
168162

169163
open override func traitCollectionDidChange(

0 commit comments

Comments
 (0)