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

custom nodes within svg aren't created #681

Closed
ghost opened this issue Aug 3, 2014 · 2 comments
Closed

custom nodes within svg aren't created #681

ghost opened this issue Aug 3, 2014 · 2 comments
Assignees

Comments

@ghost
Copy link

ghost commented Aug 3, 2014

I have an element that draws an SVG line between two HTML nodes. I'm trying to move all of these elements into a single SVG node, but the instances are never created:

Works:

<template repeat="...">
    <custom-node>
        // internal
        <svg>
            <path>

doesn't work:

<svg>
    <template repeat="...">
        <custom-node>
            // internal
             <path>

Note that in the latter case, the template repeat is applied, in that if I inspect the tree there are multiple instances of custom-node. But the Polymer controller for these elements is never instantiated.

@ebidel
Copy link
Contributor

ebidel commented Aug 3, 2014

I had some luck by wrapping the custom elements in <foreignObject>: http://jsbin.com/pigiwipa/1/edit

@dfreedm
Copy link
Member

dfreedm commented Aug 12, 2014

Anything inside of the <svg> tag is going to be in the SVG element space, and there is no SVGTemplateElement.

One workaround you can use is to put a template attribute on the svg node:

<svg template repeat="...">
  <custom-svg-node>

More information about databinding workarounds can be found here: http://www.polymer-project.org/docs/polymer/databinding-compat.html

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

No branches or pull requests

3 participants