Skip to content

Commit

Permalink
🐛 fix #9839
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Dec 7, 2023
1 parent b166fd8 commit 6bafc1b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/src/protyle/wysiwyg/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,7 @@ export class WYSIWYG {
if (range.toString() === "" ||
window.siyuan.shiftIsPressed // https://ld246.com/article/1650096678723
) {
if (event.detail === 3) {
if (event.detail > 2) {
// table 前或最后一个 cell 三击状态不对
let cursorElement = hasClosestBlock(range.startContainer) as Element;
if (cursorElement) {
Expand All @@ -1031,7 +1031,7 @@ export class WYSIWYG {
}
const startBlockElement = hasClosestBlock(range.startContainer);
let endBlockElement: false | HTMLElement;
if (mouseUpEvent.detail === 3 && range.endContainer.nodeType !== 3 && (range.endContainer as HTMLElement).tagName === "DIV" && range.endOffset === 0) {
if (mouseUpEvent.detail > 2 && range.endContainer.nodeType !== 3 && (range.endContainer as HTMLElement).tagName === "DIV" && range.endOffset === 0) {
// 三击选中段落块时,rangeEnd 会在下一个块
if ((range.endContainer as HTMLElement).classList.contains("protyle-attr") && startBlockElement) {
// 三击在悬浮层中会选择到 attr https://github.com/siyuan-note/siyuan/issues/4636
Expand Down Expand Up @@ -1376,7 +1376,11 @@ export class WYSIWYG {
} else {
nodeElement.removeAttribute("data-render");
avRender(nodeElement, protyle, () => {
openViewMenu({protyle, blockElement: nodeElement, element: nodeElement.querySelector(".item.item--focus")});
openViewMenu({
protyle,
blockElement: nodeElement,
element: nodeElement.querySelector(".item.item--focus")
});
}, avTabHeaderElement.dataset.id);
}
event.stopPropagation();
Expand Down

0 comments on commit 6bafc1b

Please sign in to comment.