Vanessa 2026-02-24 09:51:03 +08:00
parent e451114004
commit 54c657e4a9

View file

@ -1751,11 +1751,10 @@ export class WYSIWYG {
}
if (selectElement.length > 0) {
range.collapse(true);
if (range.commonAncestorContainer.nodeType === 1 &&
range.startContainer.childNodes[range.startOffset] &&
range.startContainer.childNodes[range.startOffset].nodeType === 1 &&
(range.commonAncestorContainer as HTMLElement).classList.contains("protyle-wysiwyg")) {
focusBlock(range.startContainer.childNodes[range.startOffset] as Element);
// https://github.com/siyuan-note/siyuan/issues/17092 & https://github.com/siyuan-note/siyuan/issues/15296
const endElement = hasClosestBlock(mouseUpEvent.target as HTMLElement);
if (endElement && document.activeElement.classList.contains("protyle-wysiwyg")) {
focusBlock(endElement);
}
return;
}