diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts index 5e01c180b..53772f85e 100644 --- a/app/src/protyle/wysiwyg/index.ts +++ b/app/src/protyle/wysiwyg/index.ts @@ -1066,7 +1066,9 @@ export class WYSIWYG { !selectElements[0].classList.contains("bq") && !selectElements[0].classList.contains("sb")) { // 只有一个 p 时不选中 protyle.selectElement.style.backgroundColor = "transparent"; + protyle.wysiwyg.element.classList.remove("protyle-wysiwyg--hiderange"); } else { + protyle.wysiwyg.element.classList.add("protyle-wysiwyg--hiderange"); selectElements.forEach(item => { if (!hasClosestByClassName(item, "protyle-wysiwyg__embed")) { item.classList.add("protyle-wysiwyg--select"); @@ -1084,6 +1086,9 @@ export class WYSIWYG { documentSelf.onselect = null; startFirstElement = undefined; endLastElement = undefined; + // 多选表格单元格后,选择菜单中的居左,然后 shift+左 选中的文字无法显示选中背景,因此需移除 + // 多选块后 shift+左 选中的文字无法显示选中背景,因此需移除 + protyle.wysiwyg.element.classList.remove("protyle-wysiwyg--hiderange"); this.element.querySelectorAll("iframe").forEach(item => { item.style.pointerEvents = ""; }); @@ -1379,8 +1384,6 @@ export class WYSIWYG { }).element); } window.siyuan.menus.menu.popup({x: mouseUpEvent.clientX - 8, y: mouseUpEvent.clientY - 16}); - // 多选表格单元格后,选择菜单中的居左,然后 shift+左 选中的文字无法显示选中背景,因此需移除 - protyle.wysiwyg.element.classList.remove("protyle-wysiwyg--hiderange"); } }