forked from shadowfacts/Tusker
Fix test in ContentTextView not being de-selectable
This commit is contained in:
parent
02088b1f55
commit
bbd7d82620
|
@ -171,8 +171,13 @@ class ContentTextView: LinkTextView {
|
|||
}
|
||||
}
|
||||
|
||||
// only handles link taps via the gesture recognizer which is used when selection is disabled
|
||||
@objc func textTapped(_ recognizer: UITapGestureRecognizer) {
|
||||
// if there currently is a selection, deselct it on single-tap
|
||||
if selectedRange.length > 0 {
|
||||
// location doesn't matter since we are non-editable and the cursor isn't visible
|
||||
selectedRange = NSRange(location: 0, length: 0)
|
||||
}
|
||||
|
||||
let location = recognizer.location(in: self)
|
||||
if let (link, range) = getLinkAtPoint(location) {
|
||||
let text = (self.text as NSString).substring(with: range)
|
||||
|
|
Loading…
Reference in New Issue