From 423e963a564b19ceaae7c2b2caff5b378202eea9 Mon Sep 17 00:00:00 2001 From: charles Date: Thu, 23 May 2024 02:31:14 +0900 Subject: [PATCH 1/3] 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); From 2d352434a1020a5dad49d5b9c80598cc4634c0cb Mon Sep 17 00:00:00 2001 From: Yao Date: Thu, 23 May 2024 15:41:43 +0900 Subject: [PATCH 2/3] Update src/MarkdownTextInput.web.tsx Co-authored-by: Sobit Neupane <073bct543.sobit@pcampus.edu.np> --- src/MarkdownTextInput.web.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MarkdownTextInput.web.tsx b/src/MarkdownTextInput.web.tsx index 7d07a6e6..40dc87e6 100644 --- a/src/MarkdownTextInput.web.tsx +++ b/src/MarkdownTextInput.web.tsx @@ -340,7 +340,7 @@ const MarkdownTextInput = React.forwardRef( const nativeEvent = e.nativeEvent as MarkdownNativeEvent; if (compositionRef.current && (nativeEvent.inputType !== 'insertCompositionText' || nativeEvent.data !== '*')) { - updateTextColor(divRef.current, e.target.innerText); + updateTextColor(divRef.current, changedText); compositionRef.current = false; return; } From 712bc33d6d589dcb13fef7ba7f4eef13f4803d6d Mon Sep 17 00:00:00 2001 From: charles Date: Fri, 24 May 2024 18:45:27 +0900 Subject: [PATCH 3/3] fix: IOU - one character descriptions are not saved; fixed the error code when merging --- src/MarkdownTextInput.web.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MarkdownTextInput.web.tsx b/src/MarkdownTextInput.web.tsx index 7d07a6e6..6b3b8849 100644 --- a/src/MarkdownTextInput.web.tsx +++ b/src/MarkdownTextInput.web.tsx @@ -339,8 +339,8 @@ const MarkdownTextInput = React.forwardRef( const changedText = e.target.innerText; const nativeEvent = e.nativeEvent as MarkdownNativeEvent; - if (compositionRef.current && (nativeEvent.inputType !== 'insertCompositionText' || nativeEvent.data !== '*')) { - updateTextColor(divRef.current, e.target.innerText); + if (compositionRef.current && (nativeEvent.inputType === 'insertCompositionText' || nativeEvent.data !== '*')) { + updateTextColor(divRef.current, changedText); compositionRef.current = false; return; }