Skip to content

Commit fcc247e

Browse files
Merge pull request #369 from day8/fix/popover-positional-args
Fix popover-anchor-wrapper for positional-args :popover style
2 parents d322f22 + a4ef671 commit fcc247e

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 2.29.4 (Unreleased)
2+
3+
#### Fixed
4+
- `popover-anchor-wrapper`: `:popover` argument using positional-args calling style `[popover-fn arg1 arg2 ...]` no longer breaks `:showing-injected?`/`:position-injected` injection. Previously the non-keyword branch wrapped the call as a single map, causing the receiving fn's `[a b & {:keys [...]}]` destructure to bind `a` to the entire map and produce nil kwargs — visible as a 💥 in the "Complex Popover (dialog box)" demo. Map-style invocation `[popover-fn {props}]` continues to work. [#367](https://github.com/day8/re-com/issues/367)
5+
16
## 2.29.3 (2026-04-29)
27

38
#### Added

src/re_com/popover.cljs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@
578578
(let [[orientation _arrow-pos] (split-keyword @internal-position "-") ;; only need orientation here
579579
place-anchor-before? (case orientation (:left :above) false true)
580580
flex-flow (case orientation (:left :right) "row" "column")
581-
[popover-fn & {:as popover-args}] popover]
581+
popover-fn (first popover)]
582582
[:div
583583
(merge {:class (theme/merge-class "rc-popover-anchor-wrapper"
584584
"display-inline-flex"
@@ -607,12 +607,17 @@
607607
:z-index 4}
608608
(get-in parts [:point :style]))
609609
:attr (get-in parts [:point :attr])}
610-
(if (keyword? (get popover 1))
610+
(cond
611+
(keyword? (get popover 1))
611612
(into popover [:showing-injected? showing?
612613
:position-injected internal-position])
613-
[popover-fn (merge popover-args
614+
(map? (get popover 1))
615+
[popover-fn (merge (get popover 1)
614616
{:showing-injected? showing?
615-
:position-injected internal-position})])])
617+
:position-injected internal-position})]
618+
:else
619+
(into popover [:showing-injected? showing?
620+
:position-injected internal-position]))])
616621
(when-not place-anchor-before? anchor)]]))))}))))
617622

618623
;;--------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)