mirror of
https://github.com/docmost/docmost.git
synced 2025-11-13 15:22:40 +10:00
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:
@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user