From 36d8cd82ef57483dcf3740c803c6524bc76e87c9 Mon Sep 17 00:00:00 2001 From: Hailey Date: Fri, 12 Jan 2024 23:25:17 -0800 Subject: [PATCH] reset text selection on text update --- .../expo-selectable-text/ios/ExpoSelectableTextView.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/expo-selectable-text/ios/ExpoSelectableTextView.swift b/modules/expo-selectable-text/ios/ExpoSelectableTextView.swift index 0b9c6201d3..600dff1bef 100644 --- a/modules/expo-selectable-text/ios/ExpoSelectableTextView.swift +++ b/modules/expo-selectable-text/ios/ExpoSelectableTextView.swift @@ -53,8 +53,8 @@ class ExpoSelectableTextView: ExpoView { } @IBAction func callOnPress(_ sender: UITapGestureRecognizer) -> Void { - if let segment = getPressedSegment(sender) { - if segment.handlePress, textView.selectedTextRange == nil { + if let segment = getPressedSegment(sender), segment.handlePress { + if textView.selectedTextRange == nil { onTextPress([ "index": segment.index ]) @@ -113,6 +113,7 @@ class ExpoSelectableTextView: ExpoView { } textView.attributedText = finalAttributedString + textView.selectedTextRange = nil self.setNeedsLayout() }