aboutsummaryrefslogtreecommitdiffstats
path: root/src/html
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2025-01-17 20:48:27 +0100
committerbptato <nincsnevem662@gmail.com>2025-01-17 20:48:27 +0100
commit60821d1053c22dc281498f5f9cec4dfb655f04e7 (patch)
tree4be1cc33a3baf34133c41b9ef6274755a0bd9061 /src/html
parent02184f388a4e8c06041117dbcc52d6f5344d72a5 (diff)
downloadchawan-60821d1053c22dc281498f5f9cec4dfb655f04e7.tar.gz
dom: fix input checkedness invalidation
Diffstat (limited to 'src/html')
-rw-r--r--src/html/dom.nim4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/html/dom.nim b/src/html/dom.nim
index 424d9904..4394f1a4 100644
--- a/src/html/dom.nim
+++ b/src/html/dom.nim
@@ -2965,11 +2965,15 @@ func checked*(input: HTMLInputElement): bool {.inline.} =
return input.internalChecked
proc setChecked*(input: HTMLInputElement; b: bool) {.jsfset: "checked".} =
+ # Note: input elements are implemented as a replaced text, so we must
+ # fully invalidate them on checked change.
if input.inputType == itRadio:
for radio in input.radiogroup:
radio.setInvalid(dtChecked)
+ radio.setInvalid()
radio.internalChecked = false
input.setInvalid(dtChecked)
+ input.setInvalid()
input.internalChecked = b
func inputString*(input: HTMLInputElement): string =