Vanessa 2025-04-18 16:51:18 +08:00
parent 5c739ffa77
commit f7a69e2065

View File

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