Bladeren bron

:art: fix https://github.com/siyuan-note/siyuan/issues/6653

Vanessa 2 jaren geleden
bovenliggende
commit
f64c3439f4
2 gewijzigde bestanden met toevoegingen van 2 en 2 verwijderingen
  1. 1 1
      app/src/menus/protyle.ts
  2. 1 1
      app/src/protyle/wysiwyg/index.ts

+ 1 - 1
app/src/menus/protyle.ts

@@ -275,7 +275,7 @@ export const refMenu = (protyle: IProtyle, element: HTMLElement) => {
 export const contentMenu = (protyle: IProtyle, nodeElement: Element) => {
     const range = getEditorRange(nodeElement);
     window.siyuan.menus.menu.remove();
-    if (range.toString() !== "") {
+    if (range.toString() !== "" || (range.cloneContents().childNodes[0] as HTMLElement)?.classList.contains("emoji")) {
         window.siyuan.menus.menu.append(new MenuItem({
             icon: "iconCopy",
             accelerator: "⌘C",

+ 1 - 1
app/src/protyle/wysiwyg/index.ts

@@ -1411,7 +1411,7 @@ export class WYSIWYG {
         });
 
         this.element.addEventListener("dblclick", (event: MouseEvent & { target: HTMLElement }) => {
-            if (event.target.tagName === "IMG") {
+            if (event.target.tagName === "IMG" && !event.target.classList.contains("emoji")) {
                 previewImage((event.target as HTMLImageElement).src, protyle.block.rootID);
                 return;
             }