Skip to content

Commit

Permalink
fix: prevent menu close on clicking disabled items
Browse files Browse the repository at this point in the history
  • Loading branch information
sibiraj-s committed Feb 9, 2021
1 parent 0d71d63 commit 83fc998
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ export class FloatingMenuComponent implements OnInit, OnDestroy {
execulableItems: TBItems[] = [];
activeItems: TBItems[] = [];

@HostListener('document:mousedown') onMouseDown(): void {
@HostListener('document:mousedown', ['$event']) onMouseDown(e: MouseEvent): void {
if (this.el.nativeElement.contains(e.target as Node)) {
e.preventDefault();
return;
}
this.dragging = true;
}

Expand Down

0 comments on commit 83fc998

Please sign in to comment.