Skip to content

Commit 6f879b3

Browse files
committed
fix(dragenter): find parent element on drop
1 parent 47de5ef commit 6f879b3

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

projects/ng-sortgrid/src/lib/ngsg-item.directive.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,11 @@ export class NgsgItemDirective implements OnInit, AfterViewInit, OnDestroy {
7373

7474
@HostListener('dragenter', ['$event'])
7575
dragEnter(event): void {
76-
if (!this.ngsgStore.hasSelectedItems(this.ngSortGridGroup) || !this.occuredOnHost(event)) {
76+
if (!this.ngsgStore.hasSelectedItems(this.ngSortGridGroup)) {
7777
return;
7878
}
79-
this.sortService.sort(event.target);
79+
const element = !this.occuredOnHost(event) ? NgsgElementsHelper.findHost(event.target, selector) : event.target;
80+
this.sortService.sort(element);
8081
}
8182

8283
@HostListener('dragover', ['$event'])

0 commit comments

Comments
 (0)