diff --git a/host/ide/src/trace/component/SpSystemTrace.ts b/host/ide/src/trace/component/SpSystemTrace.ts index 7b3fa61a90567b52fc920df9115b6203ec84f5d9..2fea45e488c6c564a3e58b3433bcd0a359229d69 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(); }