fix: prevent custom menu button from opening cycle/ module details page when closed. (#4025)

This commit is contained in:
Prateek Shourya 2024-03-21 20:46:33 +05:30 committed by GitHub
parent 58a45c96c0
commit 23f77328d4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -131,6 +131,7 @@ const CustomMenu = (props: ICustomMenuDropdownProps) => {
ref={setReferenceElement} ref={setReferenceElement}
type="button" type="button"
onClick={(e) => { onClick={(e) => {
e.preventDefault();
e.stopPropagation(); e.stopPropagation();
isOpen ? closeDropdown() : openDropdown(); isOpen ? closeDropdown() : openDropdown();
if (menuButtonOnClick) menuButtonOnClick(); if (menuButtonOnClick) menuButtonOnClick();
@ -157,6 +158,7 @@ const CustomMenu = (props: ICustomMenuDropdownProps) => {
: "cursor-pointer hover:bg-custom-background-80" : "cursor-pointer hover:bg-custom-background-80"
} ${buttonClassName}`} } ${buttonClassName}`}
onClick={(e) => { onClick={(e) => {
e.preventDefault();
e.stopPropagation(); e.stopPropagation();
isOpen ? closeDropdown() : openDropdown(); isOpen ? closeDropdown() : openDropdown();
if (menuButtonOnClick) menuButtonOnClick(); if (menuButtonOnClick) menuButtonOnClick();