77@implementation EditorTextView
88
99- (void )copy : (id )sender {
10- ReactNativeRichTextEditorView *typedEditor = (ReactNativeRichTextEditorView *)self. delegate ;
10+ ReactNativeRichTextEditorView *typedEditor = (ReactNativeRichTextEditorView *)_editor ;
1111 if (typedEditor == nullptr ) { return ; }
1212
1313 NSString *plainText = [typedEditor->textView.textStorage.string substringWithRange: typedEditor->textView.selectedRange];
@@ -27,7 +27,7 @@ - (void)copy:(id)sender {
2727}
2828
2929- (void )paste : (id )sender {
30- ReactNativeRichTextEditorView *typedEditor = (ReactNativeRichTextEditorView *)self. delegate ;
30+ ReactNativeRichTextEditorView *typedEditor = (ReactNativeRichTextEditorView *)_editor ;
3131 if (typedEditor == nullptr ) { return ; }
3232
3333 UIPasteboard *pasteboard = [UIPasteboard generalPasteboard ];
@@ -61,26 +61,26 @@ - (void)paste:(id)sender {
6161 if ([pasteboardTypes containsObject: UTTypePlainText.identifier]) {
6262 NSString *plainString = [pasteboard valueForPasteboardType: UTTypePlainText.identifier];
6363 currentRange.length > 0
64- ? [TextInsertionUtils replaceText: plainString inView: typedEditor->textView at: currentRange additionalAttributes: nullptr ]
65- : [TextInsertionUtils insertText: plainString inView: typedEditor->textView at: currentRange.location additionalAttributes: nullptr ];
64+ ? [TextInsertionUtils replaceText: plainString inView: typedEditor->textView at: currentRange additionalAttributes: nullptr editor: typedEditor ]
65+ : [TextInsertionUtils insertText: plainString inView: typedEditor->textView at: currentRange.location additionalAttributes: nullptr editor: typedEditor ];
6666 }
6767 }
6868 } else if ([pasteboardTypes containsObject: UTTypePlainText.identifier]) {
6969 // just plain text
7070
7171 NSString *plainString = [pasteboard valueForPasteboardType: UTTypePlainText.identifier];
7272 currentRange.length > 0
73- ? [TextInsertionUtils replaceText: plainString inView: typedEditor->textView at: currentRange additionalAttributes: nullptr ]
74- : [TextInsertionUtils insertText: plainString inView: typedEditor->textView at: currentRange.location additionalAttributes: nullptr ];
73+ ? [TextInsertionUtils replaceText: plainString inView: typedEditor->textView at: currentRange additionalAttributes: nullptr editor: typedEditor ]
74+ : [TextInsertionUtils insertText: plainString inView: typedEditor->textView at: currentRange.location additionalAttributes: nullptr editor: typedEditor ];
7575 }
7676}
7777
7878- (void )cut : (id )sender {
79- ReactNativeRichTextEditorView *typedEditor = (ReactNativeRichTextEditorView *)self. delegate ;
79+ ReactNativeRichTextEditorView *typedEditor = (ReactNativeRichTextEditorView *)_editor ;
8080 if (typedEditor == nullptr ) { return ; }
8181
8282 [self copy: sender];
83- [TextInsertionUtils replaceText: @" " inView: typedEditor->textView at: typedEditor->textView.selectedRange additionalAttributes: nullptr ];
83+ [TextInsertionUtils replaceText: @" " inView: typedEditor->textView at: typedEditor->textView.selectedRange additionalAttributes: nullptr editor: typedEditor ];
8484}
8585
8686@end
0 commit comments