Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

SVGElement hydration issue when using @html directive and IE11 #8

Open
babeard opened this issue Jul 31, 2020 · 0 comments
Open

SVGElement hydration issue when using @html directive and IE11 #8

babeard opened this issue Jul 31, 2020 · 0 comments

Comments

@babeard
Copy link

babeard commented Jul 31, 2020

I'm not sure if this is the appropriate place to file this issue, but since this repo's focus is on IE/Edge Legacy support, I thought I would start here.

The Problem

I came across a hydration bug within Svelte that relates to the @html directive and IE11's lack of support for SVGElement.prototype.innerHTML. As you can see in the example below, the icon is displayed before hydration and then disappears.

Example

<script>
  const iconData = `<line x1="12" y1="18" x2="12" y2="12"></line><line x1="9" y1="15" x2="15" y2="15"></line>`;
</script>
<div>Can you see the plus svg icon right below disappear upon hydration? 👇</div>
<svg>{@html iconData}</svg>

results in something similar to:
icon-flash

Proposed Solution

Add a polyfill

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

Successfully merging a pull request may close this issue.

1 participant