From e952f3659356dec5f9acf2d963af8432eaea6b02 Mon Sep 17 00:00:00 2001 From: charles Date: Thu, 9 May 2024 03:35:43 +0900 Subject: [PATCH] fix: IOU - one character descriptions are not saved --- src/MarkdownTextInput.web.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/MarkdownTextInput.web.tsx b/src/MarkdownTextInput.web.tsx index 4ded68c5c..e8366c390 100644 --- a/src/MarkdownTextInput.web.tsx +++ b/src/MarkdownTextInput.web.tsx @@ -329,14 +329,18 @@ const MarkdownTextInput = React.forwardRef( return; } - if (compositionRef.current) { + const nativeEvent = e.nativeEvent as MarkdownNativeEvent; + + if (compositionRef.current + && e.nativeEvent.inputType === 'insertCompositionText' + ) { 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);