Skip to content

Commit

Permalink
Update emoji font size if it was updated in markdownStyle (#475)
Browse files Browse the repository at this point in the history
  • Loading branch information
VickyStash authored Sep 12, 2024
1 parent a246d77 commit 8ffc798
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
11 changes: 8 additions & 3 deletions ios/MarkdownTextInputDecoratorView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,17 @@ - (void)setMarkdownStyle:(RCTMarkdownStyle *)markdownStyle
_markdownStyle = markdownStyle;
[_markdownUtils setMarkdownStyle:markdownStyle];

// apply new styles
if (_textView != nil) {
// We want to use `textStorage` for applying markdown when possible. Currently it's only available for UITextView
[_textView textDidChange];
} else {
// apply new styles
#ifdef RCT_NEW_ARCH_ENABLED
[_textInput _setAttributedString:_backedTextInputView.attributedText];
[_textInput _setAttributedString:_backedTextInputView.attributedText];
#else
[_textInput setAttributedText:_textInput.attributedText];
[_textInput setAttributedText:_textInput.attributedText];
#endif /* RCT_NEW_ARCH_ENABLED */
}
}

@end
4 changes: 4 additions & 0 deletions ios/RCTUITextView+Markdown.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

NS_ASSUME_NONNULL_BEGIN

@interface RCTUITextView (Private)
- (void)textDidChange;
@end

@interface RCTUITextView (Markdown)

@property(nonatomic, nullable, getter=getMarkdownUtils) RCTMarkdownUtils *markdownUtils;
Expand Down

0 comments on commit 8ffc798

Please sign in to comment.