mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-21 22:44:06 +01:00
This commit is contained in:
parent
c2c7f87475
commit
ab147598e1
2 changed files with 32 additions and 21 deletions
|
|
@ -1404,17 +1404,17 @@ export const windowKeyDown = (app: App, event: KeyboardEvent) => {
|
|||
return;
|
||||
}
|
||||
|
||||
// 闪卡长按 Esc 光标定位到闪卡按钮上 https://github.com/siyuan-note/siyuan/issues/12989
|
||||
if (document.activeElement && hasClosestByClassName(document.activeElement, "card__action")) {
|
||||
return;
|
||||
}
|
||||
// 光标在文档树等面板中,按 Esc 回到编辑器中 https://github.com/siyuan-note/siyuan/issues/4289
|
||||
let range;
|
||||
if (getSelection().rangeCount > 0) {
|
||||
range = getSelection().getRangeAt(0);
|
||||
const protypleElement = hasClosestByClassName(range.startContainer, "protyle-content", true);
|
||||
if (protypleElement) {
|
||||
const range = getSelection().getRangeAt(0);
|
||||
if (hasClosestByClassName(range.startContainer, "protyle-content", true)) {
|
||||
focusByRange(range);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
range = document.createRange();
|
||||
}
|
||||
const lastBackStack = window.siyuan.backStack[window.siyuan.backStack.length - 1];
|
||||
if (lastBackStack && lastBackStack.protyle.toolbar.range) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue