Skip to content

SVG <use> call being blocked by JS #38

Open
@mhomolak

Description

@mhomolak

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions