From 83fc998d7b27709636d963e60ac18e7b0e7f8620 Mon Sep 17 00:00:00 2001 From: sibiraj-s Date: Tue, 9 Feb 2021 10:56:31 +0530 Subject: [PATCH] fix: prevent menu close on clicking disabled items --- .../modules/menu/floating-menu/floating-menu.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/modules/menu/floating-menu/floating-menu.component.ts b/src/lib/modules/menu/floating-menu/floating-menu.component.ts index f69f94b2..d94ee22a 100644 --- a/src/lib/modules/menu/floating-menu/floating-menu.component.ts +++ b/src/lib/modules/menu/floating-menu/floating-menu.component.ts @@ -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; }