Skip to content

armgit / plane

Public Imported from GitHub
0

πŸ”₯πŸ”₯πŸ”₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.

[WEB-715] chore: closing custom dropdown on button click (#3950)

Ramesh Kumar Chandrad25fcfdd88d1
diff --git a/packages/ui/src/dropdowns/custom-menu.tsx b/packages/ui/src/dropdowns/custom-menu.tsx
index d1623dddfd..b94faf4368 100644
--- a/packages/ui/src/dropdowns/custom-menu.tsx
+++ b/packages/ui/src/dropdowns/custom-menu.tsx
@@ -114,7 +114,7 @@ const CustomMenu = (props: ICustomMenuDropdownProps) => {
type="button"
onClick={(e) => {
e.stopPropagation();
- openDropdown();
+ isOpen ? closeDropdown() : openDropdown();
if (menuButtonOnClick) menuButtonOnClick();
}}
className={customButtonClassName}
@@ -132,7 +132,7 @@ const CustomMenu = (props: ICustomMenuDropdownProps) => {
type="button"
onClick={(e) => {
e.stopPropagation();
- openDropdown();
+ isOpen ? closeDropdown() : openDropdown();
if (menuButtonOnClick) menuButtonOnClick();
}}
disabled={disabled}
@@ -158,7 +158,7 @@ const CustomMenu = (props: ICustomMenuDropdownProps) => {
} ${buttonClassName}`}
onClick={(e) => {
e.stopPropagation();
- openDropdown();
+ isOpen ? closeDropdown() : openDropdown();
if (menuButtonOnClick) menuButtonOnClick();
}}
tabIndex={customButtonTabIndex}