idiomorph has a bug introduced in the latest release 0.0.9, where it syncs the checked attribute of <input> but does not sync the checked property. it is actually one line (to[attributeName] = from[attributeName];), but there were also changes for the order for the sync of checked (and others) and value, I'll apply chesterton's fence here.
just to be sure I migrated some unit tests from nanomorph's tape test suite [1] to idiomorphs mocha test suite.
send <input type="checkbox" checked> to the client and swap the DOM using idiomorph
on client click on checkbox which will set the checked property to false, but leave the checked attribute enabled
send <input type="checkbox" checked> to the client and swap the DOM using idiomorph
now the checked property is still false. expectation is it is set to true.
technical details
checked
A boolean attribute indicating whether this checkbox is checked by default (when the page loads). It does not indicate whether this checkbox is currently checked: if the checkbox's state is changed, this content attribute does not reflect the change. (Only the HTMLInputElement's checked IDL attribute is updated.)
idiomorph has a bug introduced in the latest release 0.0.9, where it syncs the
checked
attribute of<input>
but does not sync thechecked
property. it is actually one line (to[attributeName] = from[attributeName];
), but there were also changes for the order for the sync of checked (and others) and value, I'll apply chesterton's fence here.just to be sure I migrated some unit tests from nanomorph's tape test suite [1] to idiomorphs mocha test suite.
[1] https://github.com/choojs/nanomorph/blob/v5.4.3/test/diff.js#L125-L245
steps to reproduce
<input type="checkbox" checked>
to the client and swap the DOM using idiomorphchecked
property to false, but leave thechecked
attribute enabled<input type="checkbox" checked>
to the client and swap the DOM using idiomorphchecked
property is stillfalse
. expectation is it is set totrue
.technical details