Fork me on GitHub
Lidor Cohen11:09:16

Hi, is there anyway to access to original dom/on-change

Dustin Getz12:09:45

are you trying to get an old example working? paste here and i will upgrade it

Lidor Cohen13:09:34

actually, I'm trying to fix the todo-mvc demo (the toggle-all feature, specifically):

(let [active (p/server (todo-count db :active))
                       all    (p/server (todo-count db :all))
                       done   (p/server (todo-count db :done))]
                   (ui/checkbox {::dom/class      "toggle-all"
                                 ::dom/on-change  print
                                 ::ui/value       (zero? active)
                                 ::ui/input-event (p/fn [e]
                                                    (let [any-actives? (-> e :target :checked)]
                                                      (p/server (transact! (toggle-all! db any-actives?)))))
                                 ::ui/pending     {::dom/aria-busy true}}))
                 (dom/label {:for "toggle-all"} "Mark all as complete")
for some reason checkbox doesn't receive the click event, and I'm trying to debug it so I wanted to check the browser native event handlers

Lidor Cohen13:09:48

nvm fixed 😄

Lidor Cohen13:09:47

the click was missed because it the checkbox was missing an id that relates it to the label

Dustin Getz13:09:34

Do you know if it's possible to fix without a global id? ids break the "todomvc composed" demo – we can gensym i guess, or uuid

Lidor Cohen13:09:41

can I pr somehow?

Dustin Getz14:09:45

sure you can PR to photon github repo

Lidor Cohen14:09:36

Is it a regular fork -> pr flow?