Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
JaneOri opened this issue Oct 22, 2015 · 1 comment
Closed

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

JaneOri opened this issue Oct 22, 2015 · 1 comment
Assignees
Labels
Milestone

Comments

@JaneOri
Copy link

JaneOri 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.

@JaneOri JaneOri added the bug label Oct 22, 2015
@justinbmeyer justinbmeyer added this to the 2.3.2 milestone Oct 29, 2015
@justinbmeyer
Copy link
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants