This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-10-10
Channels
- # announcements (3)
- # babashka (3)
- # beginners (83)
- # calva (1)
- # cider (19)
- # clojure (131)
- # clojure-austin (4)
- # clojure-dev (3)
- # clojure-europe (49)
- # clojure-greece (2)
- # clojure-italy (8)
- # clojure-losangeles (18)
- # clojure-nl (14)
- # clojure-poland (1)
- # clojure-uk (65)
- # clojurescript (28)
- # core-async (7)
- # core-logic (3)
- # cursive (2)
- # data-science (1)
- # datomic (98)
- # defnpodcast (1)
- # figwheel-main (6)
- # fulcro (95)
- # graphql (5)
- # hoplon (7)
- # kaocha (1)
- # lein-figwheel (6)
- # luminus (1)
- # nyc (1)
- # off-topic (21)
- # pedestal (1)
- # quil (8)
- # re-frame (15)
- # reagent (106)
- # reitit (15)
- # shadow-cljs (158)
- # sim-testing (1)
- # spacemacs (17)
- # sql (25)
Hi, I noticed the following when trying out hoplon. I couldn’t get a checkbox to work as a controlled element. The app state was correct (e.g. todo completed) and the HTML had checked="checked"
set, but the checkbox wasn’t marked. Then I learnt the attribute :checked
corresponds to the property :defaultChecked
and this is was hoplon updates in (input :type "checkbox" :checked completed?)
. So instead of (.setAttribute elem "checked" true)
, we need to do (set! elem.checked true)
or (aset elem "checked" true)
. Did anyone encounter the same thing?
@dmarjenburgh this depends on your attribute provider
I have the default
so no attribute provider?
Then this is correct behavior, attribute providers generally handle this kind of thing, I recommend using hoplon.jquery
as it works well and is stable
Ok, thanks