Vanessa 2025-03-20 23:33:51 +08:00
parent 9945ad7a7a
commit 1e62853195

View File

@ -128,6 +128,8 @@ export const initUI = (protyle: IProtyle) => {
(!event.target.classList.contains("protyle-content") && !event.target.classList.contains("protyle-wysiwyg"))) {
return;
}
// 选中最后一个块末尾点击底部时range 会有值,需等待
setTimeout(() => {
// 选中文本禁止添加空块 https://github.com/siyuan-note/siyuan/issues/13905
if (window.getSelection().rangeCount > 0) {
const currentRange = window.getSelection().getRangeAt(0);
@ -170,6 +172,7 @@ export const initUI = (protyle: IProtyle) => {
focusByRange(range);
}
}
})
});
let overAttr = false;
protyle.element.addEventListener("mouseover", (event: KeyboardEvent & { target: HTMLElement }) => {