@expensify/react-native-live-markdown 0.1.142 → 0.1.144

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -110,12 +110,17 @@
110
110
  _markdownStyle = markdownStyle;
111
111
  [_markdownUtils setMarkdownStyle:markdownStyle];
112
112
 
113
- // apply new styles
113
+ if (_textView != nil) {
114
+ // We want to use `textStorage` for applying markdown when possible. Currently it's only available for UITextView
115
+ [_textView textDidChange];
116
+ } else {
117
+ // apply new styles
114
118
  #ifdef RCT_NEW_ARCH_ENABLED
115
- [_textInput _setAttributedString:_backedTextInputView.attributedText];
119
+ [_textInput _setAttributedString:_backedTextInputView.attributedText];
116
120
  #else
117
- [_textInput setAttributedText:_textInput.attributedText];
121
+ [_textInput setAttributedText:_textInput.attributedText];
118
122
  #endif /* RCT_NEW_ARCH_ENABLED */
123
+ }
119
124
  }
120
125
 
121
126
  @end
@@ -4,6 +4,10 @@
4
4
 
5
5
  NS_ASSUME_NONNULL_BEGIN
6
6
 
7
+ @interface RCTUITextView (Private)
8
+ - (void)textDidChange;
9
+ @end
10
+
7
11
  @interface RCTUITextView (Markdown)
8
12
 
9
13
  @property(nonatomic, nullable, getter=getMarkdownUtils) RCTMarkdownUtils *markdownUtils;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expensify/react-native-live-markdown",
3
- "version": "0.1.142",
3
+ "version": "0.1.144",
4
4
  "description": "Drop-in replacement for React Native's TextInput component with Markdown formatting.",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",