Procházet zdrojové kódy

:bug: fix https://github.com/siyuan-note/siyuan/issues/6153

Vanessa před 2 roky
rodič
revize
fe827792fd
1 změnil soubory, kde provedl 2 přidání a 4 odebrání
  1. 2 4
      app/src/protyle/util/editorCommonEvent.ts

+ 2 - 4
app/src/protyle/util/editorCommonEvent.ts

@@ -308,8 +308,7 @@ const dragSame = (protyle: IProtyle, sourceElements: Element[], targetElement: E
                     topSourceElement = getTopAloneElement(item);
                     topSourceElement = getTopAloneElement(item);
                     if (topSourceElement.isSameNode(item)) {
                     if (topSourceElement.isSameNode(item)) {
                         topSourceElement = undefined;
                         topSourceElement = undefined;
-                    }
-                    if (topSourceElement.contains(item) && topSourceElement.contains(targetElement)) {
+                    } else if (topSourceElement.contains(item) && topSourceElement.contains(targetElement)) {
                         // * * 1 列表项拖拽到父级列表项下 https://ld246.com/article/1665448570858
                         // * * 1 列表项拖拽到父级列表项下 https://ld246.com/article/1665448570858
                         topSourceElement = targetElement;
                         topSourceElement = targetElement;
                     }
                     }
@@ -384,8 +383,7 @@ const dragSame = (protyle: IProtyle, sourceElements: Element[], targetElement: E
                     topSourceElement = getTopAloneElement(item);
                     topSourceElement = getTopAloneElement(item);
                     if (topSourceElement.isSameNode(item)) {
                     if (topSourceElement.isSameNode(item)) {
                         topSourceElement = undefined;
                         topSourceElement = undefined;
-                    }
-                    if (topSourceElement.contains(item) && topSourceElement.contains(targetElement)) {
+                    } else if (topSourceElement.contains(item) && topSourceElement.contains(targetElement)) {
                         // * * 1 列表项拖拽到父级列表项上 https://ld246.com/article/1665448570858
                         // * * 1 列表项拖拽到父级列表项上 https://ld246.com/article/1665448570858
                         topSourceElement = targetElement;
                         topSourceElement = targetElement;
                     }
                     }