From ed795b730a4ae63248d299d678390f1a6ab50e8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=87etin?= <69278826+cetincakiroglu@users.noreply.github.com> Date: Thu, 1 Feb 2024 20:02:23 +0300 Subject: [PATCH] Fixed #14512 --- src/app/components/dragdrop/dragdrop.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/components/dragdrop/dragdrop.ts b/src/app/components/dragdrop/dragdrop.ts index 07fa916ec69..5a3608d472a 100755 --- a/src/app/components/dragdrop/dragdrop.ts +++ b/src/app/components/dragdrop/dragdrop.ts @@ -251,8 +251,10 @@ export class Droppable implements AfterViewInit, OnDestroy { dragLeave(event: DragEvent) { event.preventDefault(); - DomHandler.removeClass(this.el.nativeElement, 'p-draggable-enter'); - this.onDragLeave.emit(event); + if (!this.el.nativeElement.contains(event.relatedTarget)) { + DomHandler.removeClass(this.el.nativeElement, 'p-draggable-enter'); + this.onDragLeave.emit(event); + } } allowDrop(event: DragEvent): boolean {