Skip to content

Commit

Permalink
Fixed bug in findin first posible responder in SelectView
Browse files Browse the repository at this point in the history
  • Loading branch information
Måns Bernhardt committed Jun 29, 2018
1 parent 4410170 commit 7b13acc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Form/SelectView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ public final class SelectView: UIView, Selectable, Highlightable {
}

public override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
if callbacker.isEmpty && detectFirstResponder {
firstPossibleResponder?.becomeFirstResponder()
} else {
callbacker.callAll(with: ())
}

guard let didHighlightTime = autoHighlightTime else { return }

guard isSingleAndInside(touches) else {
Expand All @@ -84,12 +90,6 @@ public final class SelectView: UIView, Selectable, Highlightable {
self.setHighlighted(false, animated: true)
}
autoHighlightTime = nil

if callbacker.isEmpty && detectFirstResponder {
firstPossibleResponder?.becomeFirstResponder()
} else {
callbacker.callAll(with: ())
}
}

public override func touchesCancelled(_ touches: Set<UITouch>, with event: UIEvent?) {
Expand Down

0 comments on commit 7b13acc

Please sign in to comment.