Skip to content

Commit

Permalink
Add checked to dom (nim-lang#18033)
Browse files Browse the repository at this point in the history
This allows the ability to set a checkbox as checked programmatically. It's different from `setAttribute` because once an input has been clicked on by the user, `setAttribute` no longer works programmatically.
  • Loading branch information
jyapayne authored and PMunch committed Mar 28, 2022
1 parent dcde471 commit a6f6963
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/js/dom.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1379,6 +1379,9 @@ proc `class=`*(n: Node; v: cstring) {.importcpp: "#.className = #", nodecl.}
proc value*(n: Node): cstring {.importcpp: "#.value", nodecl.}
proc `value=`*(n: Node; v: cstring) {.importcpp: "#.value = #", nodecl.}

proc checked*(n: Node): bool {.importcpp: "#.checked", nodecl.}
proc `checked=`*(n: Node; v: bool) {.importcpp: "#.checked = #", nodecl.}

proc `disabled=`*(n: Node; v: bool) {.importcpp: "#.disabled = #", nodecl.}

when defined(nodejs):
Expand Down

0 comments on commit a6f6963

Please sign in to comment.