@expensify/react-native-live-markdown 0.1.7 → 0.1.9
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.
- package/lib/commonjs/MarkdownTextInput.web.js +9 -1
- package/lib/commonjs/MarkdownTextInput.web.js.map +1 -1
- package/lib/module/MarkdownTextInput.web.js +9 -1
- package/lib/module/MarkdownTextInput.web.js.map +1 -1
- package/lib/parser/react-native-live-markdown-parser.js +18 -21
- package/lib/typescript/src/MarkdownTextInput.web.d.ts.map +1 -1
- package/package.json +1 -1
- package/parser/react-native-live-markdown-parser.js +18 -21
- package/src/MarkdownTextInput.web.tsx +9 -0
|
@@ -150,6 +150,7 @@ const MarkdownTextInput = React.forwardRef<TextInput, MarkdownTextInputProps>(
|
|
|
150
150
|
spellCheck,
|
|
151
151
|
style = {},
|
|
152
152
|
value,
|
|
153
|
+
autoFocus = false,
|
|
153
154
|
},
|
|
154
155
|
ref,
|
|
155
156
|
) => {
|
|
@@ -500,6 +501,14 @@ const MarkdownTextInput = React.forwardRef<TextInput, MarkdownTextInputProps>(
|
|
|
500
501
|
};
|
|
501
502
|
}, []);
|
|
502
503
|
|
|
504
|
+
useEffect(() => {
|
|
505
|
+
// focus the input on mount if autoFocus is set
|
|
506
|
+
if (!(divRef.current && autoFocus)) {
|
|
507
|
+
return;
|
|
508
|
+
}
|
|
509
|
+
divRef.current.focus();
|
|
510
|
+
}, []);
|
|
511
|
+
|
|
503
512
|
return (
|
|
504
513
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
505
514
|
<div
|