fix ctrl-enter post form shortcut skipping plugin confirm dialogs

This commit is contained in:
bunnybeam 2025-11-29 21:16:32 +00:00
parent 8c196d5cb2
commit 677f9f111e
No known key found for this signature in database

View file

@ -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.