diff --git a/ios/input/ENRMInputTextView.mm b/ios/input/ENRMInputTextView.mm index 187cf5b4..ce0004fe 100644 --- a/ios/input/ENRMInputTextView.mm +++ b/ios/input/ENRMInputTextView.mm @@ -34,7 +34,7 @@ - (void)copy:(id)sender - (void)cut:(id)sender { [self copy:sender]; - [self replaceRange:self.selectedTextRange withText:@""]; + [self.markdownTextInput replaceSelectedTextWith:@"" formattingRanges:@[]]; } - (void)paste:(id)sender @@ -111,9 +111,7 @@ - (void)copy:(id)sender - (void)cut:(id)sender { [self copy:sender]; - if (self.selectedRange.length > 0) { - [self insertText:@"" replacementRange:self.selectedRange]; - } + [self.markdownTextInput replaceSelectedTextWith:@"" formattingRanges:@[]]; } - (void)paste:(id)sender diff --git a/ios/input/EnrichedMarkdownTextInput.h b/ios/input/EnrichedMarkdownTextInput.h index b8c6e3ca..2e67a50e 100644 --- a/ios/input/EnrichedMarkdownTextInput.h +++ b/ios/input/EnrichedMarkdownTextInput.h @@ -11,6 +11,7 @@ NS_ASSUME_NONNULL_BEGIN - (CGSize)measureSize:(CGFloat)maxWidth; - (nullable NSString *)markdownForSelectedRange; - (void)pasteMarkdown:(NSString *)markdown; +- (void)replaceSelectedTextWith:(NSString *)text formattingRanges:(NSArray *)ranges; - (void)scheduleRelayoutIfNeeded; @end diff --git a/ios/input/EnrichedMarkdownTextInput.mm b/ios/input/EnrichedMarkdownTextInput.mm index 798e1038..08177d3a 100644 --- a/ios/input/EnrichedMarkdownTextInput.mm +++ b/ios/input/EnrichedMarkdownTextInput.mm @@ -41,7 +41,6 @@ - (void)setupTextView; - (void)applyFormatting; - (void)toggleInlineStyle:(ENRMInputStyleType)styleType; - (void)resetBaseTypingAttributes; -- (void)replaceSelectedTextWith:(NSString *)text formattingRanges:(NSArray *)ranges; @end @implementation EnrichedMarkdownTextInput {