@expensify/react-native-live-markdown 0.1.111 → 0.1.113
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 +6 -3
- package/lib/commonjs/MarkdownTextInput.web.js.map +1 -1
- package/lib/module/MarkdownTextInput.web.js +6 -3
- package/lib/module/MarkdownTextInput.web.js.map +1 -1
- package/lib/parser/react-native-live-markdown-parser.js +2 -2
- package/lib/typescript/src/MarkdownTextInput.web.d.ts.map +1 -1
- package/package.json +1 -1
- package/parser/react-native-live-markdown-parser.js +2 -2
- package/src/MarkdownTextInput.web.tsx +10 -3
|
@@ -16,7 +16,6 @@ import {StyleSheet} from 'react-native';
|
|
|
16
16
|
import * as ParseUtils from './web/parserUtils';
|
|
17
17
|
import * as CursorUtils from './web/cursorUtils';
|
|
18
18
|
import * as StyleUtils from './styleUtils';
|
|
19
|
-
import * as BrowserUtils from './web/browserUtils';
|
|
20
19
|
import type * as MarkdownTextInputDecoratorViewNativeComponent from './MarkdownTextInputDecoratorViewNativeComponent';
|
|
21
20
|
import './web/MarkdownTextInput.css';
|
|
22
21
|
import InputHistory from './web/InputHistory';
|
|
@@ -355,9 +354,8 @@ const MarkdownTextInput = React.forwardRef<TextInput, MarkdownTextInputProps>(
|
|
|
355
354
|
const prevSelection = contentSelection.current ?? {start: 0, end: 0};
|
|
356
355
|
const prevTextLength = CursorUtils.getPrevTextLength() ?? 0;
|
|
357
356
|
const changedText = e.target.innerText;
|
|
358
|
-
if (compositionRef.current
|
|
357
|
+
if (compositionRef.current) {
|
|
359
358
|
updateTextColor(divRef.current, changedText);
|
|
360
|
-
compositionRef.current = false;
|
|
361
359
|
return;
|
|
362
360
|
}
|
|
363
361
|
|
|
@@ -582,6 +580,14 @@ const MarkdownTextInput = React.forwardRef<TextInput, MarkdownTextInputProps>(
|
|
|
582
580
|
compositionRef.current = true;
|
|
583
581
|
}, []);
|
|
584
582
|
|
|
583
|
+
const endComposition = useCallback(
|
|
584
|
+
(e) => {
|
|
585
|
+
compositionRef.current = false;
|
|
586
|
+
handleOnChangeText(e);
|
|
587
|
+
},
|
|
588
|
+
[handleOnChangeText],
|
|
589
|
+
);
|
|
590
|
+
|
|
585
591
|
const setRef = (currentRef: HTMLDivElement | null) => {
|
|
586
592
|
const r = currentRef;
|
|
587
593
|
if (r) {
|
|
@@ -683,6 +689,7 @@ const MarkdownTextInput = React.forwardRef<TextInput, MarkdownTextInputProps>(
|
|
|
683
689
|
className={className}
|
|
684
690
|
onKeyDown={handleKeyPress}
|
|
685
691
|
onCompositionStart={startComposition}
|
|
692
|
+
onCompositionEnd={endComposition}
|
|
686
693
|
onKeyUp={updateSelection}
|
|
687
694
|
onInput={handleOnChangeText}
|
|
688
695
|
onClick={handleClick}
|