From f9e9e43242b3d8b7d0ce8cd1ec83534d7baf1848 Mon Sep 17 00:00:00 2001 From: zhaokaishan Date: Thu, 23 Mar 2023 17:02:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B6=E8=97=8F=E5=A4=B9=E5=85=83=E7=B4=A0?= =?UTF-8?q?=E5=90=91=E4=B8=8B=E6=8B=96=E5=8A=A8=E6=8E=92=E5=BA=8Fbugfix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhaokaishan --- host/ide/src/trace/component/SpSystemTrace.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/host/ide/src/trace/component/SpSystemTrace.ts b/host/ide/src/trace/component/SpSystemTrace.ts index 7b3fa61..2fea45e 100644 --- a/host/ide/src/trace/component/SpSystemTrace.ts +++ b/host/ide/src/trace/component/SpSystemTrace.ts @@ -198,12 +198,12 @@ export class SpSystemTrace extends BaseElement { ev.dataTransfer.dropEffect = "move"; }); currentRow.addEventListener("drop", (ev: any) => { - if (this.currentClickRow != null && this.currentClickRow !== currentRow) { + if (this.favoriteRowsEL != null && this.currentClickRow != null && this.currentClickRow !== currentRow) { let rect = currentRow.getBoundingClientRect(); if (ev.clientY >= rect.top && ev.clientY < rect.top + rect.height / 2) { //向上移动 - this.favoriteRowsEL?.insertBefore(this.currentClickRow!, currentRow); + this.favoriteRowsEL.insertBefore(this.currentClickRow, currentRow); } else if (ev.clientY <= rect.bottom && ev.clientY > rect.top + rect.height / 2) { //向下移动 - this.favoriteRowsEL?.insertBefore(currentRow, this.currentClickRow!); + this.favoriteRowsEL.insertBefore(this.currentClickRow, currentRow.nextSibling); } this.refreshFavoriteCanvas(); } -- Gitee