Skip to content

Commit

Permalink
fix: fix children display error when dropEnterPredicate return false …
Browse files Browse the repository at this point in the history
…#INFR-8641
  • Loading branch information
HandsomeButterball committed Jul 18, 2023
1 parent 1f5fdca commit 54c3455
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,16 @@ export class GanttTableBodyComponent implements OnInit, OnDestroy, AfterViewInit

onItemDragEnded(event: CdkDragEnd<GanttItemInternal>) {
this.ganttTableDragging = false;

this.dragEnded.emit({
source: event.source.data?.origin,
sourceParent: this.getParentByItem(event.source.data)?.origin
});
// dropEnterPredicate 方法返回值为 false 时,始终未执行 onListDropped,所以只能在 dragEnded 中移除 drag-item-hide
const children = this.getChildrenElementsByElement(event.source.element.nativeElement);
children.forEach((element) => {
element.classList.remove('drag-item-hide');
});
}

onListDropped(event: CdkDragDrop<GanttItemInternal[], GanttItemInternal[], GanttItemInternal>) {
Expand Down

0 comments on commit 54c3455

Please sign in to comment.