Skip to content

Commit c666690

Browse files
authored
fix: iOS startMention check range (#278)
<!-- Thanks for submitting a pull request! We appreciate you spending the time to work on these changes. Please follow the template so that the reviewers can easily understand what the code changes affect --> # Summary The `startMention` ref method on iOS takes wrong range into consideration when checking for blocks and conflicts. Can't be reproduced in the current state of main branch, but on the codeblocks feature branch I was not able to add an indicator this way because a codeblock was detected within default `NSRange` value `(0,0)`. This PR puts a proper `textView.selectedRange` range in there. ## Test Plan -- ## Screenshots / Videos -- ## Compatibility | OS | Implemented | | ------- | :---------: | | iOS | ✅ | | Android | (doesn't apply) |
1 parent 67c9cc0 commit c666690

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ios/EnrichedTextInputView.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ - (void)startMentionWithIndicator:(NSString *)indicator {
921921
MentionStyle *mentionStyleClass = (MentionStyle *)stylesDict[@([MentionStyle getStyleType])];
922922
if(mentionStyleClass == nullptr) { return; }
923923

924-
if([self handleStyleBlocksAndConflicts:[MentionStyle getStyleType] range:[[mentionStyleClass getActiveMentionRange] rangeValue]]) {
924+
if([self handleStyleBlocksAndConflicts:[MentionStyle getStyleType] range:textView.selectedRange]) {
925925
[mentionStyleClass startMentionWithIndicator:indicator];
926926
[self anyTextMayHaveBeenModified];
927927
}

0 commit comments

Comments
 (0)