Skip to content

Commit

Permalink
Fixed #14935 - Drag-and-Drop Functionality Disrupted by extra tag (di…
Browse files Browse the repository at this point in the history
…v) in <td> Tag
  • Loading branch information
mehmetcetin01140 committed Mar 4, 2024
1 parent 90830b2 commit 4ec11da
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/app/components/table/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4878,8 +4878,12 @@ export class ReorderableRow implements AfterViewInit {
}

onMouseDown(event: Event) {
if (DomHandler.hasClass(event.target, 'p-datatable-reorderablerow-handle')) this.el.nativeElement.draggable = true;
else this.el.nativeElement.draggable = false;
const targetElement = event.target as HTMLElement;
const parentElement = targetElement.parentNode as HTMLElement;

const isHandleClicked = DomHandler.hasClass(targetElement, 'p-datatable-reorderablerow-handle') || DomHandler.hasClass(parentElement, 'p-datatable-reorderablerow-handle');

this.el.nativeElement.draggable = isHandleClicked;
}

onDragStart(event: DragEvent) {
Expand Down

0 comments on commit 4ec11da

Please sign in to comment.