add ctrl+s to save modal on Editor modals

Signed-off-by: Ronni Skansing <rskansing@gmail.com>
This commit is contained in:
Ronni Skansing
2025-11-29 10:57:29 +01:00
parent e534660fd7
commit 4fec3c41a1

View File

@@ -15,8 +15,12 @@
function handleKeydown(event) {
if (event.ctrlKey && event.key === 's') {
// only trigger if the form or its descendants have focus and we're in update mode
if (modalMode === 'update' && formElement && formElement.contains(document.activeElement)) {
// trigger if the form or its descendants have focus and we're in create, update, or copy mode
if (
(modalMode === 'create' || modalMode === 'update' || modalMode === 'copy') &&
formElement &&
formElement.contains(document.activeElement)
) {
event.preventDefault();
event.stopPropagation();
event.stopImmediatePropagation();