This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-09-04
Channels
- # beginners (14)
- # boot (28)
- # chestnut (9)
- # cljsrn (18)
- # clojure (64)
- # clojure-conj (1)
- # clojure-dusseldorf (45)
- # clojure-finland (4)
- # clojure-gamedev (1)
- # clojure-greece (8)
- # clojure-italy (22)
- # clojure-russia (4)
- # clojure-spec (19)
- # clojure-uk (38)
- # clojurescript (49)
- # code-reviews (2)
- # component (12)
- # core-async (3)
- # cursive (3)
- # data-science (2)
- # events (4)
- # fulcro (394)
- # heroku (3)
- # hoplon (16)
- # immutant (11)
- # jobs (5)
- # lein-figwheel (1)
- # lumo (18)
- # off-topic (8)
- # om (11)
- # other-languages (1)
- # overtone (1)
- # pedestal (7)
- # portkey (62)
- # protorepl (1)
- # re-frame (40)
- # reagent (41)
- # ring-swagger (5)
- # spacemacs (5)
- # unrepl (5)
- # yada (12)
i don't think :css
should be getting stripped
can you provide the actual code where it is missing?
i can run it through a test to confirm
Ok, let me try to recreate the issue...
Hmm, it's not happening now, let me see if there's anything obvious about the state of the code when I was having problems
(defelem feed-item [{item :item path :path :as attrs} _]
(let [[get-item title item-path link content] (get-item-cells item)
toggled (cell false)
leftover-attrs (dissoc attrs :item :path)]
(article leftover-attrs
(header (h3 (a :href link title)) " "
(button :click #(dosync (get-item @base-url @path @item-path)
(swap! toggled not))
">>"))
(div :class (cell= {"content" true "displayed" toggled "hidden" (not toggled)})
:html content))))
(defelem feed-view [{feed :feed} _]
(let [[url title path feed-cell items item-count] (get-feed-entry-cells base-url feed)
child-width (cell= (column-width item-count))]
(section
(if-tpl (cell= (> item-count 0))
(div
(header (h2 title) (p url))
(loop-tpl :bindings [item items]
(feed-item :path path :item item :css {:width child-width})))))))
I'm still reading through it to see if I can spot a mistake, but I think this was the code that was acting strangely
Hmm, I think the :css {:width child-width}
part might be missing a cell=
It looks like that was the issue
i've done the same thing a few times
easy to forget that you need the cell for css
It would be nice if hoplon could treat cells passed as values of the map the way it treats cells as an attribute value.
@fiddlerwoaroof i'm on the fence about that. i feel the ratio of convenience to complexity isn't a clear win
it wouldn't just be for that one css attribute, you'd have to teach it how to traverse arbitrarily nested data structures for any attribute and what to do when it finds a cell at any level
and you'd have to decide if/what to do with event handler functions in nested structures
the thing is that atm you can always build up a map in the way that you want in a let
or something and then pass the final composite value through to :css