From c5644a5fe839cc6aa937ac3c0be0596a8ca094c0 Mon Sep 17 00:00:00 2001 From: Juanfran Date: Thu, 30 Jan 2025 09:45:38 +0100 Subject: [PATCH] :bug: Fix combobox dropdown visibility when no options are provided (#9753) --- .../src/app/main/ui/ds/controls/combobox.cljs | 24 ++++++++++--------- .../src/app/main/ui/ds/controls/combobox.scss | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/frontend/src/app/main/ui/ds/controls/combobox.cljs b/frontend/src/app/main/ui/ds/controls/combobox.cljs index b4f5b69da..f66008d14 100644 --- a/frontend/src/app/main/ui/ds/controls/combobox.cljs +++ b/frontend/src/app/main/ui/ds/controls/combobox.cljs @@ -9,6 +9,7 @@ [app.common.data.macros :as dm] [app.main.style :as stl]) (:require + [app.common.data :as d] [app.main.ui.ds.controls.shared.options-dropdown :refer [options-dropdown*]] [app.main.ui.ds.foundations.assets.icon :refer [icon* icon-list] :as i] [app.util.array :as array] @@ -242,17 +243,18 @@ :on-change on-input-change :on-key-down on-key-down}]] - [:> :button {:type "button" - :tab-index "-1" - :aria-expanded open - :aria-controls listbox-id - :class (stl/css :button-toggle-list) - :on-click on-click} - [:> icon* {:icon-id i/arrow - :class (stl/css :arrow) - :size "s" - :aria-hidden true - :data-testid "combobox-open-button"}]]] + (when (d/not-empty? options) + [:> :button {:type "button" + :tab-index "-1" + :aria-expanded open + :aria-controls listbox-id + :class (stl/css :button-toggle-list) + :on-click on-click} + [:> icon* {:icon-id i/arrow + :class (stl/css :arrow) + :size "s" + :aria-hidden true + :data-testid "combobox-open-button"}]])] (when (and open (seq dropdown-options)) [:> options-dropdown* {:on-click on-option-click diff --git a/frontend/src/app/main/ui/ds/controls/combobox.scss b/frontend/src/app/main/ui/ds/controls/combobox.scss index 25a01887c..1bb19bb8f 100644 --- a/frontend/src/app/main/ui/ds/controls/combobox.scss +++ b/frontend/src/app/main/ui/ds/controls/combobox.scss @@ -46,7 +46,7 @@ .focused { --combobox-outline-color: var(--color-accent-primary); - --combobox-bg-color: var(--color-background-secondary); + --combobox-bg-color: var(--color-background-primary); } .arrow {