Skip to content
This repository has been archived by the owner on Aug 10, 2024. It is now read-only.

Commit

Permalink
Merge pull request #147 from kwebio/issue-146-Make_checked_work_prope…
Browse files Browse the repository at this point in the history
…rly_in_InputElement

Fix issue #146
  • Loading branch information
sanity authored May 22, 2020
2 parents 6a7f197 + bc2b7f2 commit 5cfaa56
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/kotlin/kweb/prelude.kt
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ fun ElementCreator<Element>.input(type: InputType? = null, name: String? = null,
}

open class InputElement(override val element: Element) : ValueElement(element) {
fun checked(checked: Boolean) = setAttributeRaw("checked", checked)
fun checked(checked: Boolean) = if(checked) setAttributeRaw("checked", checked) else removeAttribute("checked")


fun select() = element.execute("$jsExpression.select();")
Expand Down

0 comments on commit 5cfaa56

Please sign in to comment.