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

<foreignObject> elements do not render when inserted via a <slot> #7563

Open
nmsmith opened this issue May 27, 2022 · 1 comment
Open

<foreignObject> elements do not render when inserted via a <slot> #7563

nmsmith opened this issue May 27, 2022 · 1 comment

Comments

@nmsmith
Copy link

nmsmith commented May 27, 2022

Describe the bug

When a foreignObject (i.e nested HTML) is inserted into a <slot> of an SVG-based component, it will not render correctly. However, if the foreignObject appears directly in the component, it renders as expected.

This bug may have the same underlying cause as this issue, which was closed despite not being fixed.

Reproduction

The issue is reproduced here. I've defined two components which should produce the same HTML. But as it so happens, only the first component renders correctly.

Note: if you remove the outermost <div> in App.svelte, both components render correctly. I have no idea why.

Logs

No response

System Info

System:
    OS: macOS 12.0.1
    CPU: (8) arm64 Apple M1
    Memory: 121.45 MB / 8.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.14.2 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 8.5.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 101.0.4951.64
    Firefox: 98.0.2
    Safari: 15.1
  npmPackages:
    svelte: ^3.44.0 => 3.46.4

Severity

annoyance

@Prinzhorn
Copy link
Contributor

Prinzhorn commented May 27, 2022

This is very similar to #7450 and #7807

Array.from(document.querySelectorAll('foreignObject')).map(e => e.namespaceURI)

0: "http://www.w3.org/2000/svg"
1: "http://www.w3.org/1999/xhtml" <=============

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