Skip to content

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