Skip to content

Commit 007a464

Browse files
authored
fix(ios): dismiss text selection when tapping non-interactive area (#162)
1 parent d83e38f commit 007a464

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

ios/EnrichedMarkdown.mm

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,12 @@ - (void)textTapped:(UITapGestureRecognizer *)recognizer
721721
if (eventEmitter) {
722722
eventEmitter->onLinkPress({.url = std::string([url UTF8String])});
723723
}
724+
return;
725+
}
726+
727+
// Tapping on non-interactive area: dismiss any active text selection
728+
if (textView.selectedTextRange != nil) {
729+
textView.selectedTextRange = nil;
724730
}
725731
}
726732

ios/EnrichedMarkdownText.mm

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,12 @@ - (void)textTapped:(UITapGestureRecognizer *)recognizer
565565
if (eventEmitter) {
566566
eventEmitter->onLinkPress({.url = std::string([url UTF8String])});
567567
}
568+
return;
569+
}
570+
571+
// Tapping on non-interactive area: dismiss any active text selection
572+
if (textView.selectedTextRange != nil) {
573+
textView.selectedTextRange = nil;
568574
}
569575
}
570576

0 commit comments

Comments
 (0)