reset text selection on text update
This commit is contained in:
@@ -53,8 +53,8 @@ class ExpoSelectableTextView: ExpoView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@IBAction func callOnPress(_ sender: UITapGestureRecognizer) -> Void {
|
@IBAction func callOnPress(_ sender: UITapGestureRecognizer) -> Void {
|
||||||
if let segment = getPressedSegment(sender) {
|
if let segment = getPressedSegment(sender), segment.handlePress {
|
||||||
if segment.handlePress, textView.selectedTextRange == nil {
|
if textView.selectedTextRange == nil {
|
||||||
onTextPress([
|
onTextPress([
|
||||||
"index": segment.index
|
"index": segment.index
|
||||||
])
|
])
|
||||||
@@ -113,6 +113,7 @@ class ExpoSelectableTextView: ExpoView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
textView.attributedText = finalAttributedString
|
textView.attributedText = finalAttributedString
|
||||||
|
textView.selectedTextRange = nil
|
||||||
|
|
||||||
self.setNeedsLayout()
|
self.setNeedsLayout()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user