Skip to content

Commit c5ef775

Browse files
committed
fix(droppable): correctly account for scroll events when dragging elements
Fixes #23
1 parent e95b5a0 commit c5ef775

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/droppable.directive.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,14 @@ export class DroppableDirective implements OnInit, OnDestroy {
7777
ngOnInit(): void {
7878
this.currentDragSubscription = this.draggableHelper.currentDrag.subscribe(
7979
drag$ => {
80-
const droppableRectangle = this.element.nativeElement.getBoundingClientRect();
81-
8280
let currentDragDropData: any;
8381
const overlaps$ = drag$.pipe(
8482
map(({ clientX, clientY, dropData }) => {
8583
currentDragDropData = dropData;
8684
return isCoordinateWithinRectangle(
8785
clientX,
8886
clientY,
89-
droppableRectangle
87+
this.element.nativeElement.getBoundingClientRect()
9088
);
9189
})
9290
);

0 commit comments

Comments
 (0)