This commit is contained in:
parent
72752f441a
commit
22a1339079
1 changed files with 3 additions and 2 deletions
|
@ -1030,9 +1030,10 @@ export class WYSIWYG {
|
|||
let endBlockElement: false | HTMLElement;
|
||||
if (mouseUpEvent.detail === 3 && range.endContainer.nodeType !== 3 && (range.endContainer as HTMLElement).tagName === "DIV" && range.endOffset === 0) {
|
||||
// 三击选中段落块时,rangeEnd 会在下一个块
|
||||
if ((range.endContainer as HTMLElement).classList.contains("protyle-attr")) {
|
||||
if ((range.endContainer as HTMLElement).classList.contains("protyle-attr") && startBlockElement) {
|
||||
// 三击在悬浮层中会选择到 attr https://github.com/siyuan-note/siyuan/issues/4636
|
||||
setLastNodeRange((range.endContainer as HTMLElement).previousElementSibling, range, false);
|
||||
// 需要获取可编辑元素,使用 previousElementSibling 的话会 https://github.com/siyuan-note/siyuan/issues/9714
|
||||
setLastNodeRange(getContenteditableElement(startBlockElement), range, false);
|
||||
}
|
||||
} else {
|
||||
endBlockElement = hasClosestBlock(range.endContainer);
|
||||
|
|
Loading…
Add table
Reference in a new issue