From 23f77328d40a549b2bab3d89254a110da8e06767 Mon Sep 17 00:00:00 2001 From: Prateek Shourya Date: Thu, 21 Mar 2024 20:46:33 +0530 Subject: [PATCH] fix: prevent custom menu button from opening cycle/ module details page when closed. (#4025) --- packages/ui/src/dropdowns/custom-menu.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/ui/src/dropdowns/custom-menu.tsx b/packages/ui/src/dropdowns/custom-menu.tsx index b94faf436..549c83fe7 100644 --- a/packages/ui/src/dropdowns/custom-menu.tsx +++ b/packages/ui/src/dropdowns/custom-menu.tsx @@ -131,6 +131,7 @@ const CustomMenu = (props: ICustomMenuDropdownProps) => { ref={setReferenceElement} type="button" onClick={(e) => { + e.preventDefault(); e.stopPropagation(); isOpen ? closeDropdown() : openDropdown(); if (menuButtonOnClick) menuButtonOnClick(); @@ -157,6 +158,7 @@ const CustomMenu = (props: ICustomMenuDropdownProps) => { : "cursor-pointer hover:bg-custom-background-80" } ${buttonClassName}`} onClick={(e) => { + e.preventDefault(); e.stopPropagation(); isOpen ? closeDropdown() : openDropdown(); if (menuButtonOnClick) menuButtonOnClick();