The existence of the selected attribute on an option tag implies true
So using Attr.selected false results in the option being selected.
I was able to reproduce this on jsfiddle using just the following html
<select>
<option></option>
<option selected="false">I am not selected</option>
</select>
I'm not sure how easy it is to make sutil not generate the attribute when given a false value, but it seems the html spec is quite terribly designed.
Additional issues that arise from this are that instead of being able to Bind.attr you have to bind the entire element to get localized observed addition/removal of the attribute.
Per https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option and https://stackoverflow.com/questions/1033944/what-values-can-appear-in-the-selected-attribute-of-the-option-tag
The existence of the selected attribute on an option tag implies true So using
Attr.selected false
results in the option being selected. I was able to reproduce this on jsfiddle using just the following htmlI'm not sure how easy it is to make sutil not generate the attribute when given a false value, but it seems the html spec is quite terribly designed.
Additional issues that arise from this are that instead of being able to
Bind.attr
you have to bind the entire element to get localized observed addition/removal of the attribute.