You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Domina's set-value! doesn't work to change the value attribute of a checkbox. Looking at the code, I see this is because it's implemented by calling Google Closure Library's goog.dom.forms/setValue, whose code does not set the value of the value attribute of checkboxes, but it adds or removes the checked attribute (see the setInputChecked_ function in the same file, which, BTW, it has this comment "This seems potentially unintuitive since it doesn't set the value property").
On the other hand, Domina's value function only returns a checkbox value attribute if the checkbox is checked. Again, this is because value relies on Closure Library's equivalent function (getValue) which has this behavior for checkboxes.
I find these set-value! and value behaviors for checkboxes very uintuitive (besides, they made me waste a lot of time!) as they change the semantics of value in the HTML spec apparently for no reason.
I've raised the issue in Closure Library's mailing list but nobody replied as of now. I wonder... don't you agree that the current behavior is not correct? If so, should this be fixed in Domina, or should we wait for this to be fixed in Closure Library?
The text was updated successfully, but these errors were encountered:
Domina's
set-value!
doesn't work to change thevalue
attribute of a checkbox. Looking at the code, I see this is because it's implemented by calling Google Closure Library'sgoog.dom.forms/setValue
, whose code does not set the value of thevalue
attribute of checkboxes, but it adds or removes thechecked
attribute (see thesetInputChecked_
function in the same file, which, BTW, it has this comment "This seems potentially unintuitive since it doesn't set the value property").On the other hand, Domina's
value
function only returns a checkboxvalue
attribute if the checkbox is checked. Again, this is becausevalue
relies on Closure Library's equivalent function (getValue
) which has this behavior for checkboxes.I find these
set-value!
andvalue
behaviors for checkboxes very uintuitive (besides, they made me waste a lot of time!) as they change the semantics ofvalue
in the HTML spec apparently for no reason.I've raised the issue in Closure Library's mailing list but nobody replied as of now. I wonder... don't you agree that the current behavior is not correct? If so, should this be fixed in Domina, or should we wait for this to be fixed in Closure Library?
The text was updated successfully, but these errors were encountered: