From 423e963a564b19ceaae7c2b2caff5b378202eea9 Mon Sep 17 00:00:00 2001 From: charles Date: Thu, 23 May 2024 02:31:14 +0900 Subject: [PATCH] fix: IOU - one character descriptions are not saved --- src/MarkdownTextInput.web.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/MarkdownTextInput.web.tsx b/src/MarkdownTextInput.web.tsx index 13c00e6d..7d07a6e6 100644 --- a/src/MarkdownTextInput.web.tsx +++ b/src/MarkdownTextInput.web.tsx @@ -62,6 +62,7 @@ interface MarkdownTextInputProps extends TextInputProps { interface MarkdownNativeEvent extends Event { inputType: string; + data: string; } type Selection = { @@ -337,14 +338,14 @@ const MarkdownTextInput = React.forwardRef( } const changedText = e.target.innerText; - if (compositionRef.current) { - updateTextColor(divRef.current, changedText); + const nativeEvent = e.nativeEvent as MarkdownNativeEvent; + if (compositionRef.current && (nativeEvent.inputType !== 'insertCompositionText' || nativeEvent.data !== '*')) { + updateTextColor(divRef.current, e.target.innerText); compositionRef.current = false; return; } let text = ''; - const nativeEvent = e.nativeEvent as MarkdownNativeEvent; switch (nativeEvent.inputType) { case 'historyUndo': text = undo(divRef.current);