Hi all,
There's a (minor) bug in can.stache rendering that prevents
dynamically setting the "readonly" attribute, as in
- <input type="text" {{#if isReadOnly}}readonly{{/if}} />
Notice that setting "disabled" works fine, but
"readonly" has no effect.
Apparently, the bug is in function set(el, attrName, val) in
"can/util/attr/attr". It ends up setting el.readonly when
the correct property name is el.readOnly. Writing the template
attribute as "readOnly" or even "read-only"
doesn't help since the first thing the function does is convert
attribute name to lowercase.
Contrast this to jQuery.prop() implementation - it uses
jQuery.propFix hash that maps "readonly" to "readOnly".