Skip to content

Commit

Permalink
[single-dropdown] Fix ref fn
Browse files Browse the repository at this point in the history
  • Loading branch information
kimo-k committed Aug 8, 2024
1 parent 33b02ca commit 2babb53
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

> Committed but unreleased changes are put here, at the top. Older releases are detailed chronologically below.
## 2.21.18 (2024-08-09)

#### Fixed
- `single-dropdown` - `:can-drop-above?` now works again.

## 2.21.17 (2024-08-07)

#### Added
Expand Down
6 changes: 3 additions & 3 deletions src/re_com/dropdown.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,7 @@
free-text-sel-range (reagent/atom nil)
focus-free-text #(when @free-text-input (.focus @free-text-input))
node (reagent/atom nil)
ref-callback #(reset! node %)
focus-anchor #(some-> @node (.getElementsByClassName "chosen-single") (.item 0) (.focus))]
(load-choices "" regex-filter? false)
(fn single-dropdown-render
Expand Down Expand Up @@ -1017,12 +1018,11 @@
:style (merge (flex-child-style (if width "0 0 auto" "auto"))
(align-style :align-self :start)
{:width width}
style)
:ref #(reset! node %)}
style)}
(when tooltip
{:on-mouse-over (handler-fn (reset! over? true))
:on-mouse-out (handler-fn (reset! over? false))})
(->attr args)
(->attr (assoc-in args [:attr :ref] ref-callback))
attr)
anchor
(when (and @drop-showing? (not disabled?))
Expand Down

0 comments on commit 2babb53

Please sign in to comment.