Skip to content

Commit 7068bd9

Browse files
authored
Merge pull request #358 from day8/qol/table-filter
Improve tag-dropdown sizing and defaults
2 parents 11e4775 + beba4c9 commit 7068bd9

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 2.28.4 (2025-09-29)
2+
3+
#### Added
4+
- `tag-dropdown`: added `:max-height` parameter with reasonable default for dropdown menu
5+
- `table-filter`: improved `tag-dropdown` sizing defaults within filter interface
6+
17
## 2.28.4 (...)
28

39
#### Added

demo/re_demo/table_filter.cljs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@
2727
:options [{:id "clojure" :label "Clojure"}
2828
{:id "javascript" :label "JavaScript"}
2929
{:id "python" :label "Python"}
30-
{:id "java" :label "Java"}]}])
30+
{:id "java" :label "Java"}
31+
{:id "rust" :label "Rust"}
32+
{:id "C" :label "C"}]}])
3133

3234
(defn panel
3335
[]

src/re_com/table_filter.cljs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,7 @@
451451
:choices options
452452
:placeholder "Select values..."
453453
:min-width "220px"
454+
:max-width "600px"
454455
:show-only-button? true
455456
:show-counter? true
456457
:on-change #(on-change (assoc filter-spec :val %))

src/re_com/tag_dropdown.cljs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@
160160
{:name :min-width :required false :type "string" :validate-fn string? :description [:span "the CSS min-width, like \"100px\" or \"20em\". This is the natural display width of the Component. It prevents the width from becoming smaller than the value specified, yet allows growth horizontally if sufficient choices are selected up to " [:code ":max-width"] " or unbounded growth if " [:code ":max-width"] " is not provided."]}
161161
{:name :max-width :required false :type "string" :validate-fn string? :description "the CSS max-width, like \"100px\" or \"20em\". It prevents the width from becoming larger than the value specified. If sufficient choices are selected to go beyond the maximum then some choices will be hidden by overflow."}
162162
{:name :height :required false :default "25px" :type "string" :validate-fn string? :description "the specific height of the component"}
163+
{:name :max-height :required false :default "380px" :type "string" :validate-fn string? :description "the maximum height of the dropdown menu"}
163164
{:name :style :required false :type "map" :validate-fn map? :description "CSS styles to add or override"}
164165
{:name :parts :required false :type "map" :validate-fn (parts? tag-dropdown-parts) :description "See Parts section below."}
165166
{:name :src :required false :type "map" :validate-fn map? :description [:span "Used in dev builds to assist with debugging. Source code coordinates map containing keys" [:code ":file"] "and" [:code ":line"] ". See 'Debugging'."]}
@@ -172,10 +173,11 @@
172173
(let [showing? (reagent/atom false)]
173174
(fn tag-dropdown-render
174175
[& {:keys [choices model placeholder on-change unselect-buttons? required? show-only-button? show-counter? abbrev-fn abbrev-threshold label-fn
175-
description-fn min-width max-width height style disabled? parts src debug-as]
176+
description-fn min-width max-width height max-height style disabled? parts src debug-as]
176177
:or {label-fn :label
177178
description-fn :description
178179
height "25px"
180+
max-height "380px"
179181
show-only-button? false
180182
show-counter? false}
181183
:as args}]
@@ -217,6 +219,7 @@
217219
:disabled? disabled?
218220
:required? required?
219221
:show-only-button? show-only-button?
222+
:max-height max-height
220223
:parts (->
221224
(select-keys parts selection-list/selection-list-parts)
222225
(assoc-in-if-empty [:list-group-item :style :border] "1px solid #ddd")

0 commit comments

Comments
 (0)