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

Support boolean values for boolean attributes #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

schneiderfelipe
Copy link
Contributor

Fix #20. Implemented as suggested in comment:

julia> using Hyperscript

julia> m("input", type="checkbox", checked=true)
<input checked="" type="checkbox" />

julia> m("input", type="checkbox", checked=false)
<input type="checkbox" />

julia> m("input", type="text", value=true)  # as string if not a boolean attribute
<input value="true" type="text" />

julia> m("input", type="checkbox", checked="true")  # boolean attributes expect booleans
<inputError showing value of type Hyperscript.Node{Hyperscript.HTMLSVG}:
ERROR: Boolean attribute "checked" expects `Bool`, found `String`: <input> checked=true  />
Stacktrace:
  ...

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.

support boolean values for boolean attributes
1 participant