mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-27 20:08:49 +01:00
fix: 选中文本或块时,禁止添加空块 (#13975)
fix https://github.com/siyuan-note/siyuan/issues/13905
This commit is contained in:
parent
124e4fcc5f
commit
95f1c08e96
1 changed files with 2 additions and 1 deletions
|
|
@ -115,7 +115,8 @@ export const initUI = (protyle: IProtyle) => {
|
|||
}, {passive: true});
|
||||
protyle.contentElement.addEventListener("click", (event: MouseEvent & { target: HTMLElement }) => {
|
||||
// wysiwyg 元素下方点击无效果 https://github.com/siyuan-note/siyuan/issues/12009
|
||||
if (protyle.disabled ||
|
||||
// 选中文本或块时,禁止添加空块 https://github.com/siyuan-note/siyuan/issues/13905
|
||||
if (protyle.disabled || window.getSelection().toString().length > 0 || event.target.querySelector(".protyle-wysiwyg--select") ||
|
||||
(!event.target.classList.contains("protyle-content") && !event.target.classList.contains("protyle-wysiwyg"))) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue