fix ctrl-enter post form shortcut skipping plugin confirm dialogs
This commit is contained in:
parent
8c196d5cb2
commit
677f9f111e
1 changed files with 4 additions and 1 deletions
|
|
@ -676,7 +676,10 @@ function clear() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function onKeydown(ev: KeyboardEvent) {
|
function onKeydown(ev: KeyboardEvent) {
|
||||||
if (ev.key === 'Enter' && (ev.ctrlKey || ev.metaKey) && canPost.value) post();
|
if (ev.key === 'Enter' && (ev.ctrlKey || ev.metaKey) && canPost.value) {
|
||||||
|
ev.preventDefault();
|
||||||
|
post();
|
||||||
|
}
|
||||||
|
|
||||||
// justEndedComposition.value is for Safari, which keyDown occurs after compositionend.
|
// justEndedComposition.value is for Safari, which keyDown occurs after compositionend.
|
||||||
// ev.isComposing is for another browsers.
|
// ev.isComposing is for another browsers.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue