1
0

Fix search & replace (Cmd-f/ctrl-f)

This commit is contained in:
Zef Hemel 2022-07-19 13:49:54 +02:00
parent 5cc1fc0a25
commit 552c8afcc0

View File

@ -163,7 +163,14 @@ export class Editor {
// Make keyboard shortcuts work even when the editor is in read only mode or not focused
window.addEventListener("keydown", (ev) => {
if (!this.editorView?.hasFocus) {
console.log("Window-level keyboard event", ev);
// console.log(
// "Window-level keyboard event",
// ev
// );
if ((ev.target as any).classList.contains("cm-textfield")) {
// Search & replace feature, ignore this
return;
}
if (runScopeHandlers(this.editorView!, ev, "editor")) {
ev.preventDefault();
}