feat: Ctrl/Cmd+S: prevent 'Save As' dialog (#1272)

* init

* remove: force save

* switch from event.key to event.code by sanua356
This commit is contained in:
fuscodev
2025-07-14 11:36:24 +02:00
committed by GitHub
parent e51a93221c
commit 6792a191b1

View File

@ -217,6 +217,10 @@ export default function PageEditor({
scrollMargin: 80,
handleDOMEvents: {
keydown: (_view, event) => {
if ((event.ctrlKey || event.metaKey) && event.code === 'KeyS') {
event.preventDefault();
return true;
}
if (["ArrowUp", "ArrowDown", "Enter"].includes(event.key)) {
const slashCommand = document.querySelector("#slash-command");
if (slashCommand) {