Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checkbox inputs don't update "checked" value on rerender #194

Closed
ultimapanzer opened this issue Apr 18, 2018 · 3 comments
Closed

Checkbox inputs don't update "checked" value on rerender #194

ultimapanzer opened this issue Apr 18, 2018 · 3 comments

Comments

@ultimapanzer
Copy link

Checkbox inputs that are controlled don't update the checked value when it changes.

assume (let [{:keys [checked?]} (om/get-state this)] ....)
[:input {:type "checkbox" :checked checked? :on-change (...)]

(componentDidMount [this]
  (js/setTimeout #(om/update-state! this assoc :checked? true) 1000)

The input's checked status doesn't change. But this one will:

(js/React.createElement "input" #js {:type "checkbox" :checked checked? :onChange (...})
@r0man
Copy link
Owner

r0man commented Apr 19, 2018

@ultimapanzer Looks like a regression introduced by this: d1469ae
I added a test case and a fix for this. Can you try 0.8.4-SNAPSHOT, please?

@ultimapanzer
Copy link
Author

ultimapanzer commented Apr 19, 2018

This fixes it, thanks! If I'm understanding the change correctly, this feels like a CLJS equivalent of == vs === lol. Thanks again for the rapid response, our team loves this library 👍

@r0man
Copy link
Owner

r0man commented Apr 19, 2018

Not really == vs ===, but yes, this is a mess :/

@r0man r0man closed this as completed Apr 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants