Skip to content

Commit

Permalink
fix: add bar index when drag #INFR-8617 (#404)
Browse files Browse the repository at this point in the history
* fix: add bar index when drag #INFR-8617

* fix: add draggingItem in GanttDragContainer

* fix: fix drag style
  • Loading branch information
HandsomeButterball authored Aug 2, 2023
1 parent c69eaab commit a17bf27
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 0 additions & 2 deletions packages/gantt/src/components/bar/bar-drag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,12 +348,10 @@ export class GanttBarDrag implements OnDestroy {
}

private setDraggingStyles() {
this.barElement.style.pointerEvents = 'none';
this.barElement.classList.add('gantt-bar-draggable-drag');
}

private clearDraggingStyles() {
this.barElement.style.pointerEvents = '';
this.barElement.classList.remove('gantt-bar-draggable-drag');
}

Expand Down
4 changes: 4 additions & 0 deletions packages/gantt/src/components/bar/bar.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ $gantt-bar-link-drop-border: 5px;
}
}

&-draggable-drag {
z-index: 1001;
}

&-drop-active {
@include active-bar();

Expand Down
4 changes: 4 additions & 0 deletions packages/gantt/src/components/bar/bar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ export class NgxGanttBarComponent extends GanttItemUpper implements OnInit, Afte

override ngOnInit() {
super.ngOnInit();
this.dragContainer.dragStarted.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
this.elementRef.nativeElement.style.pointerEvents = 'none';
});
this.dragContainer.dragEnded.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
this.elementRef.nativeElement.style.pointerEvents = '';
this.setContentBackground();
});
}
Expand Down

0 comments on commit a17bf27

Please sign in to comment.