File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -411,6 +411,7 @@ const htmlStyle: HtmlStyle = {
411411const styles = StyleSheet . create ( {
412412 container : {
413413 flex : 1 ,
414+ backgroundColor : 'white' ,
414415 } ,
415416 content : {
416417 flexGrow : 1 ,
Original file line number Diff line number Diff line change @@ -1091,10 +1091,15 @@ - (void)anyTextMayHaveBeenModified {
10911091 [self tryUpdatingHeight ];
10921092 // update active styles as well
10931093 [self tryUpdatingActiveStyles ];
1094+
10941095 // update drawing
1095- NSRange wholeRange = NSMakeRange (0 , textView.textStorage .string .length );
1096- [textView.layoutManager invalidateLayoutForCharacterRange: wholeRange actualCharacterRange: nullptr ];
1097- [textView.layoutManager invalidateDisplayForCharacterRange: wholeRange];
1096+ dispatch_async (dispatch_get_main_queue (), ^{
1097+ NSRange wholeRange = NSMakeRange (0 , textView.textStorage .string .length );
1098+ NSRange actualRange = NSMakeRange (0 , 0 );
1099+ [textView.layoutManager invalidateLayoutForCharacterRange: wholeRange actualCharacterRange: &actualRange];
1100+ [textView.layoutManager ensureLayoutForCharacterRange: actualRange];
1101+ [textView.layoutManager invalidateDisplayForCharacterRange: wholeRange];
1102+ });
10981103}
10991104
11001105// MARK: - UITextView delegate methods
You can’t perform that action at this time.
0 commit comments