Skip to content

Commit

Permalink
🎨 fix #5203
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Jun 18, 2022
1 parent 8ba59c7 commit 96a1e4c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/src/assets/scss/_text-field.scss
Expand Up @@ -27,7 +27,7 @@
}

&--text {
border: 0;
box-shadow: 0 0 0;

&:focus {
box-shadow: 0 0 0;
Expand Down
14 changes: 14 additions & 0 deletions app/src/protyle/toolbar/index.ts
Expand Up @@ -806,6 +806,7 @@ export class Toolbar {
});
textElement.value = Lute.UnEscapeHTMLStr(renderElement.getAttribute("data-content") || "");
}

textElement.addEventListener("input", (event) => {
if (!renderElement.parentElement) {
return;
Expand Down Expand Up @@ -865,6 +866,19 @@ export class Toolbar {
if (event.isComposing) {
return;
}
/// #if !BROWSER
if (matchHotKey(window.siyuan.config.keymap.editor.general.undo.custom, event)) {
getCurrentWindow().webContents.undo();
event.preventDefault();
return;
}
if (matchHotKey(window.siyuan.config.keymap.editor.general.redo.custom, event)) {
getCurrentWindow().webContents.redo();
event.preventDefault();
return;
}
/// #endif

if (event.key === "Escape" || matchHotKey("⌘Enter", event)) {
this.subElement.classList.add("fn__none");
this.subElement.querySelector('[data-type="pin"]').classList.remove("ft__primary");
Expand Down

0 comments on commit 96a1e4c

Please sign in to comment.