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

Allow passing values that are not strings as :value for inputs #183

Merged
merged 1 commit into from
Jan 26, 2018

Conversation

gacelita
Copy link
Contributor

@gacelita gacelita commented Jan 23, 2018

When you create an :input element with a :value that is not a string (in my case, a number), the element will skip one in every two :value updates, because of what happens in this code:

;; interpreter.clc:L60
;; suppose state-value is 14, and element-value is "14"
;; first branch gets executed, but it's the second branch we want here (the one which updates the input with a new `:value` from the props)
;; as a result, the new prop is ignored
(if (not= state-value element-value)
  (update-state this new-props property element-value)
  (update-state this new-props property (object/get new-props property)))

Adding str fixes the problem.

@r0man r0man merged commit d1469ae into r0man:master Jan 26, 2018
@r0man
Copy link
Owner

r0man commented Jan 26, 2018

@JoelSanchez Thanks!

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

Successfully merging this pull request may close these issues.

2 participants