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

SVG <use> call being blocked by JS #38

Open
mhomolak opened this issue Feb 22, 2017 · 2 comments
Open

SVG <use> call being blocked by JS #38

mhomolak opened this issue Feb 22, 2017 · 2 comments

Comments

@mhomolak
Copy link

I am trying to use a custom svg and am having mixed success or none at all when injecting it into the template. I have used these in other JS applications without issues.

<button class="o-dropdown-menu__menu-close">
  <svg role="img"
      aria-labelledby="r2"
      focusable="false"
      class="my-icon">
    <title id="r2">Close dropdown menu</title>
    <use xlink:href="#my-icon"></use>
  </svg>
</button>`

When using xlink:href the SVG does not render at all and after investigation it appears as if the use call is being blocked. If I removed the xlink: and solely use href the svg renders in every browser but Safari.

Hoping you might be able to provide some insight.

@mhomolak mhomolak changed the title SVG use call being blocked by JS SVG <use> call being blocked by JS Feb 22, 2017
@davidjamesstone
Copy link
Owner

I can't look at this at the moment and I haven't used SVG with incremental-dom much so I don't have a lot of experience.

Do any of these issues help?

You code looks fine to me - I might be able to take a look at it this weekend.

Thanks

Dave

@mhomolak
Copy link
Author

The second issue did help. It looks like a year and a half ago they added SVG support but not full SVG support. I'm not seeing the xlink:href attribute handled in their pull request which explains why it's not rendering for me. Thanks for your assistance!

Mike

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

2 participants