Skip to content

Commit

Permalink
fix: IOU - one character descriptions are not saved
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-liang committed May 8, 2024
1 parent 6452f69 commit e952f36
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/MarkdownTextInput.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -329,14 +329,18 @@ const MarkdownTextInput = React.forwardRef<TextInput, MarkdownTextInputProps>(
return;
}

if (compositionRef.current) {
const nativeEvent = e.nativeEvent as MarkdownNativeEvent;

if (compositionRef.current
&& e.nativeEvent.inputType === 'insertCompositionText'

Check failure on line 335 in src/MarkdownTextInput.web.tsx

View workflow job for this annotation

GitHub Actions / check

Property 'inputType' does not exist on type 'Event'.
) {
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);
Expand Down

0 comments on commit e952f36

Please sign in to comment.