π₯π₯π₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.
TypeScript boardsbug-trackerdjangodockerganttissue-trackerjirajira-alternativekanbanlinearpostgresqlproduct-managementproject-managementproject-planningpythonreactredistypesciptvitework-management
[WEB-1098] chore: dropdowns enhancement (#4375)
Anmol Singh Bhatiaa85517de99a0
diff --git a/packages/ui/src/dropdowns/custom-search-select.tsx b/packages/ui/src/dropdowns/custom-search-select.tsxindex d1778e31aa..275506ad73 100644--- a/packages/ui/src/dropdowns/custom-search-select.tsx+++ b/packages/ui/src/dropdowns/custom-search-select.tsx@@ -66,6 +66,11 @@ export const CustomSearchSelect = (props: ICustomSearchSelectProps) => {const handleKeyDown = useDropdownKeyDown(openDropdown, closeDropdown, isOpen);useOutsideClickDetector(dropdownRef, closeDropdown);+ const toggleDropdown = () => {+ if (isOpen) closeDropdown();+ else openDropdown();+ };+return (<Comboboxas="div"@@ -90,7 +95,7 @@ export const CustomSearchSelect = (props: ICustomSearchSelectProps) => {? "cursor-not-allowed text-custom-text-200": "cursor-pointer hover:bg-custom-background-80"} ${customButtonClassName}`}- onClick={openDropdown}+ onClick={toggleDropdown}>{customButton}</button>@@ -107,7 +112,7 @@ export const CustomSearchSelect = (props: ICustomSearchSelectProps) => {? "cursor-not-allowed text-custom-text-200": "cursor-pointer hover:bg-custom-background-80"} ${buttonClassName}`}- onClick={openDropdown}+ onClick={toggleDropdown}>{label}{!noChevron && !disabled && <ChevronDown className="h-3 w-3" aria-hidden="true" />}diff --git a/packages/ui/src/dropdowns/custom-select.tsx b/packages/ui/src/dropdowns/custom-select.tsxindex 2d669cc05e..4c4009b1b1 100644--- a/packages/ui/src/dropdowns/custom-select.tsx+++ b/packages/ui/src/dropdowns/custom-select.tsx@@ -47,6 +47,11 @@ const CustomSelect = (props: ICustomSelectProps) => {const handleKeyDown = useDropdownKeyDown(openDropdown, closeDropdown, isOpen);useOutsideClickDetector(dropdownRef, closeDropdown);+ const toggleDropdown = () => {+ if (isOpen) closeDropdown();+ else openDropdown();+ };+return (<Listboxas="div"@@ -67,7 +72,7 @@ const CustomSelect = (props: ICustomSelectProps) => {className={`flex items-center justify-between gap-1 text-xs ${disabled ? "cursor-not-allowed text-custom-text-200" : "cursor-pointer hover:bg-custom-background-80"} ${customButtonClassName}`}- onClick={openDropdown}+ onClick={toggleDropdown}>{customButton}</button>@@ -82,7 +87,7 @@ const CustomSelect = (props: ICustomSelectProps) => {} ${disabled ? "cursor-not-allowed text-custom-text-200" : "cursor-pointer hover:bg-custom-background-80"} ${buttonClassName}`}- onClick={openDropdown}+ onClick={toggleDropdown}>{label}{!noChevron && !disabled && <ChevronDown className="h-3 w-3" aria-hidden="true" />}