svgEl.className is readOnly so live binding does not work #2015

Closed
James0x57 opened this Issue Oct 22, 2015 · 1 comment

Comments

Projects
None yet
3 participants
@James0x57
Contributor

James0x57 commented Oct 22, 2015

SVG elements class name is readOnly so the only way to set it is to use
svgEl.setAttribute( "class", "..." );

This means that this:
<svg class="{{#if cond}}liveBoundClassName{{/if}}"></svg>
does not work.

@James0x57 James0x57 added the bug label Oct 22, 2015

@justinbmeyer justinbmeyer added this to the 2.3.2 milestone Oct 29, 2015

@justinbmeyer

This comment has been minimized.

Show comment
Hide comment
@justinbmeyer

justinbmeyer Oct 29, 2015

Contributor

fix is to probably sniff out if the element is SVG and change how you set the value.

Basically class here: https://github.com/bitovi/canjs/blob/master/util/attr/attr.js#L41

Should be changed to do setting with a function more like:

https://github.com/bitovi/canjs/blob/master/util/attr/attr.js#L50

Contributor

justinbmeyer commented Oct 29, 2015

fix is to probably sniff out if the element is SVG and change how you set the value.

Basically class here: https://github.com/bitovi/canjs/blob/master/util/attr/attr.js#L41

Should be changed to do setting with a function more like:

https://github.com/bitovi/canjs/blob/master/util/attr/attr.js#L50

Alfredo-Delgado added a commit that referenced this issue Oct 30, 2015

Alfredo-Delgado added a commit that referenced this issue Oct 30, 2015

Alfredo-Delgado added a commit that referenced this issue Oct 31, 2015

Alfredo-Delgado added a commit that referenced this issue Oct 31, 2015

@justinbmeyer justinbmeyer closed this in #2048 Nov 6, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment