fixed ctrl+s not getting triggered in the editor field

This commit is contained in:
Gani Georgiev
2023-04-19 10:33:24 +03:00
parent 0420a00c18
commit fdf4f6d3bd
34 changed files with 154 additions and 118 deletions
+10
View File
@@ -1324,6 +1324,16 @@ export default class CommonHelper {
input.click();
},
setup: (editor) => {
editor.on('keydown', (e) => {
// propagate save shortcut to the parent
if (e.ctrlKey && e.code == "KeyS" && editor.formElement) {
e.preventDefault();
e.stopPropagation();
editor.formElement.dispatchEvent(new KeyboardEvent("keydown", e));
}
})
},
};
}