diff --git a/app/src/plugin/loader.ts b/app/src/plugin/loader.ts index 7c0d3c100..b5c77ddc2 100644 --- a/app/src/plugin/loader.ts +++ b/app/src/plugin/loader.ts @@ -158,7 +158,7 @@ const mergePluginHotkey = (plugin: Plugin) => { } window.siyuan.config.keymap.plugin[plugin.name][dockKey]["default"] = dock.config.hotkey; } - }) + }); }; export const afterLoadPlugin = (plugin: Plugin) => { @@ -222,7 +222,7 @@ export const afterLoadPlugin = (plugin: Plugin) => { }); Object.keys(plugin.docks).forEach(key => { const dock = plugin.docks[key]; - const hotkey = window.siyuan.config.keymap.plugin[plugin.name][key].custom + const hotkey = window.siyuan.config.keymap.plugin[plugin.name][key].custom; if (dock.config.position.startsWith("Left")) { window.siyuan.layout.leftDock.genButton([{ type: key, diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts index 4d6856e68..6d062429d 100644 --- a/app/src/protyle/wysiwyg/index.ts +++ b/app/src/protyle/wysiwyg/index.ts @@ -875,11 +875,17 @@ export class WYSIWYG { return; } let firstBlockElement = hasClosestBlock(firstElement); + if (!firstBlockElement && firstElement.classList.contains("protyle-breadcrumb__bar")) { + firstBlockElement = firstElement.nextElementSibling as HTMLElement; + } if (moveEvent.clientY > y) { if (!startFirstElement) { // 向上选择导致滚动条滚动到顶部再向下选择至 > y 时,firstBlockElement 为 undefined https://ld246.com/article/1705233964097 if (!firstBlockElement) { firstBlockElement = protyle.wysiwyg.element.firstElementChild as HTMLElement; + if (firstBlockElement.classList.contains("protyle-breadcrumb__bar")) { + firstBlockElement = firstBlockElement.nextElementSibling as HTMLElement; + } } startFirstElement = firstBlockElement; } @@ -887,6 +893,9 @@ export class WYSIWYG { // https://github.com/siyuan-note/siyuan/issues/7580 moveEvent.clientY < protyle.wysiwyg.element.lastElementChild.getBoundingClientRect().bottom) { firstBlockElement = protyle.wysiwyg.element.firstElementChild as HTMLElement; + if (firstBlockElement.classList.contains("protyle-breadcrumb__bar")) { + firstBlockElement = firstBlockElement.nextElementSibling as HTMLElement; + } } let selectElements: Element[] = []; let currentElement: Element | boolean = firstBlockElement; @@ -915,7 +924,9 @@ export class WYSIWYG { hasJump = true; } } else { - selectElements.push(currentElement); + if (!currentElement.classList.contains("protyle-breadcrumb__bar")) { + selectElements.push(currentElement); + } currentElement = currentElement.nextElementSibling; } } else if (currentElement.parentElement.classList.contains("sb")) {