HS: fix as Values SELECT + multi-select programmatic changes
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 18s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 18s
- hs-value-of-node: use selectedIndex fallback when SELECT.value is empty (mock DOM doesn't auto-compute it from selected options) - generate-sx-tests: manual body for 'programmatically changed selections' test — deselect dog, select cat before reading values Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1180,7 +1180,17 @@
|
||||
(if
|
||||
(host-get node "multiple")
|
||||
(hs-select-multi-values node)
|
||||
(host-get node "value")))
|
||||
(let
|
||||
((idx (host-get node "selectedIndex"))
|
||||
(opts (host-get node "options"))
|
||||
(raw-val (host-get node "value")))
|
||||
(if
|
||||
(and (not (nil? raw-val)) (not (= raw-val "")))
|
||||
raw-val
|
||||
(if
|
||||
(and (not (nil? opts)) (>= idx 0))
|
||||
(host-get (if (list? opts) (nth opts idx) (host-get opts idx)) "value")
|
||||
"")))))
|
||||
((or (= typ "checkbox") (= typ "radio"))
|
||||
(if (host-get node "checked") (host-get node "value") nil))
|
||||
(true (host-get node "value"))))))
|
||||
|
||||
Reference in New Issue
Block a user