Skip to content

Commit 2f1acbe

Browse files
authored
fix: make setValue cause same sideffects as normal text change (#119)
1 parent 27d0560 commit 2f1acbe

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

ios/ReactNativeRichTextEditorView.mm

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -748,13 +748,9 @@ - (void)setValue:(NSString *)value {
748748
[parser replaceWholeFromHtml:initiallyProcessedHtml];
749749
}
750750

751-
// update the placeholder
752-
[self setPlaceholderLabelShown:textView.textStorage.string.length == 0];
753-
754-
// reset typing attribtues if the text was emptied
755-
if(textView.textStorage.string.length == 0) {
756-
textView.typingAttributes = defaultTypingAttributes;
757-
}
751+
// set recentlyChangedRange and check for changes
752+
recentlyChangedRange = NSMakeRange(0, textView.textStorage.string.length);
753+
[self anyTextMayHaveBeenModified];
758754
}
759755

760756
- (void)emitOnLinkDetectedEvent:(NSString *)text url:(NSString *)url {

0 commit comments

Comments
 (0)