From b15f915df3ef2b08dc45ec48baeb7c0aa6712ca0 Mon Sep 17 00:00:00 2001 From: Kimo Knowles Date: Fri, 9 Feb 2024 18:07:51 +0100 Subject: [PATCH] [experiment] Fix duplicate keys we passed a seq of two seqs as :children to a v-table. Reagent unpacks the seqs when it renders. Between the two seqs, there are sometimes duplicate keys. @hipitihop caught a warning for this, but I can't repro. Wrapped each inner seq in its own v-table. Ostensibly, this should prevent duplicate keys on child elements. For #412 --- src/day8/re_frame_10x/panels/subs/views.cljs | 42 +++++++++++--------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/src/day8/re_frame_10x/panels/subs/views.cljs b/src/day8/re_frame_10x/panels/subs/views.cljs index 312afef1..6e7084d0 100644 --- a/src/day8/re_frame_10x/panels/subs/views.cljs +++ b/src/day8/re_frame_10x/panels/subs/views.cljs @@ -458,26 +458,30 @@ :style {:overflow-x "hidden" :overflow-y "auto"} :children - [(for [p all-subs] - ^{:key (:id p)} - [pod (merge p - (get sub-expansions (:id p)) - (get sub-pins (:id p)))]) + [[rc/v-box + :children + (for [p all-subs] + ^{:key (:id p)} + [pod (merge p + (get sub-expansions (:id p)) + (get sub-pins (:id p)))])] (when (seq intra-epoch-subs) - (list - ^{:key "intra-epoch-line"} - [rc/line :size styles/gs-2s - :style {:margin "19px 0px"}] - ^{:key "intra-epoch-title"} - [:h2 {:class "bm-heading-text" - :style {:margin "19px 0px"}} - [rc/hyperlink-href - :class (styles/hyperlink ambiance) - :href "https://github.com/day8/re-frame-10x/blob/master/docs/HyperlinkedInformation/IntraEpoch.md" - :label "Intra-Epoch Subscriptions"]] - (for [p intra-epoch-subs] - ^{:key (:id p)} - [pod (merge p (get sub-expansions (:id p)))])))]]]])) + [rc/v-box + :children + (list + ^{:key "intra-epoch-line"} + [rc/line :size styles/gs-2s + :style {:margin "19px 0px"}] + ^{:key "intra-epoch-title"} + [:h2 {:class "bm-heading-text" + :style {:margin "19px 0px"}} + [rc/hyperlink-href + :class (styles/hyperlink ambiance) + :href "https://github.com/day8/re-frame-10x/blob/master/docs/HyperlinkedInformation/IntraEpoch.md" + :label "Intra-Epoch Subscriptions"]] + (for [p intra-epoch-subs] + ^{:key (:id p)} + [pod (merge p (get sub-expansions (:id p)))]))])]]]])) (defn filter-section [] [inputs/search