WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit b59840b

Browse files
committed
move prevent
1 parent 2fab169 commit b59840b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

web_src/js/features/comp/EditorMarkdown.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,9 @@ function handlePairCharacter(textarea: HTMLTextAreaElement, e: KeyboardEvent): v
207207
const selStart = textarea.selectionStart;
208208
const selEnd = textarea.selectionEnd;
209209
if (selEnd === selStart) return; // do not process when no selection
210+
e.preventDefault();
210211
const openChar = e.key;
211212
const closeChar = pairs[e.key];
212-
e.preventDefault();
213213
const inner = textarea.value.substring(selStart, selEnd);
214214
replaceTextareaSelection(textarea, `${openChar}${inner}${closeChar}`);
215215
textarea.setSelectionRange(selStart + 1, selEnd + 1);

0 commit comments

Comments
 (0)