Browse Source

:art: https://github.com/siyuan-note/siyuan/issues/11275

Vanessa 1 year ago
parent
commit
0018632ee4
1 changed files with 3 additions and 1 deletions
  1. 3 1
      app/src/dialog/message.ts

+ 3 - 1
app/src/dialog/message.ts

@@ -22,7 +22,9 @@ export const initMessage = () => {
             } else if (target.tagName === "A" || target.tagName === "BUTTON") {
                 break;
             } else if (target.classList.contains("b3-snackbar")) {
-                hideMessage(target.getAttribute("data-id"));
+                if (getSelection().rangeCount === 0 || !getSelection().getRangeAt(0).toString()) {
+                    hideMessage(target.getAttribute("data-id"));
+                }
                 event.preventDefault();
                 event.stopPropagation();
                 break;