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

New svelte:element tag does not handle void tags correctly #7449

Closed
ghost opened this issue Apr 13, 2022 · 2 comments · Fixed by #7453
Closed

New svelte:element tag does not handle void tags correctly #7449

ghost opened this issue Apr 13, 2022 · 2 comments · Fixed by #7453
Labels

Comments

@ghost
Copy link

ghost commented Apr 13, 2022

Describe the bug

Unable to use svelte:element with this={'input'} as it adds a closing </input> tag on the rendered html.

Reproduction

<svelte:element this={'input'}></svelte:element> renders as <input></input> instead of <input>

Logs

No response

System Info

System:
    OS: macOS 12.3.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 2.67 GB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.10.0 - /usr/local/bin/node
    npm: 8.4.1 - /usr/local/bin/npm
  Browsers:
    Chrome: 100.0.4896.88
    Safari: 15.4
  npmPackages:
    rollup: ^2.70.1 => 2.70.1

Severity

annoyance

@Conduitry
Copy link
Member

In SSR, it looks like we'll need to check whether a given tag name is for a void element at runtime. The is_void function in src/compiler/utils/names.ts will need to get moved to something that's exposed in svelte/internal.

@Conduitry
Copy link
Member

This should be fixed in 3.48.0.

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

Successfully merging a pull request may close this issue.

1 participant