diff --git a/example/src/App.tsx b/example/src/App.tsx index c36dd628b..10c7dc04f 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -411,6 +411,7 @@ const htmlStyle: HtmlStyle = { const styles = StyleSheet.create({ container: { flex: 1, + backgroundColor: 'white', }, content: { flexGrow: 1, diff --git a/ios/EnrichedTextInputView.mm b/ios/EnrichedTextInputView.mm index 7ad7893a8..9c99a0cd1 100644 --- a/ios/EnrichedTextInputView.mm +++ b/ios/EnrichedTextInputView.mm @@ -1091,10 +1091,15 @@ - (void)anyTextMayHaveBeenModified { [self tryUpdatingHeight]; // update active styles as well [self tryUpdatingActiveStyles]; + // update drawing - NSRange wholeRange = NSMakeRange(0, textView.textStorage.string.length); - [textView.layoutManager invalidateLayoutForCharacterRange:wholeRange actualCharacterRange:nullptr]; - [textView.layoutManager invalidateDisplayForCharacterRange:wholeRange]; + dispatch_async(dispatch_get_main_queue(), ^{ + NSRange wholeRange = NSMakeRange(0, textView.textStorage.string.length); + NSRange actualRange = NSMakeRange(0, 0); + [textView.layoutManager invalidateLayoutForCharacterRange:wholeRange actualCharacterRange:&actualRange]; + [textView.layoutManager ensureLayoutForCharacterRange:actualRange]; + [textView.layoutManager invalidateDisplayForCharacterRange:wholeRange]; + }); } // MARK: - UITextView delegate methods