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

[🐞] SVGs move from named slot to default slot when re-rendered at runtime #7270

Open
rondonjon opened this issue Jan 19, 2025 · 0 comments
Labels
STATUS-1: needs triage New issue which needs to be triaged TYPE: bug Something isn't working

Comments

@rondonjon
Copy link

Which component is affected?

Qwik Runtime

Describe the bug

I stumbled upon this problem with @qwikest/icons, but it seems to be affecting SVG nodes in general.

My app wants to render some icons into named slots.

When the page renders for the first time, all icons are properly rendered into their designated slots. Once the page re-renders on the client side, the icons are all rendered in the default slot.

Reproduction

https://github.com/rondonjon/qwik-repro-svg-icon-slots

Steps to reproduce

The reproduction repository contains a simple Qwik app. The app has a <Repro> component with a named slot "red" and a default slot. The root page instantiates the <Repro> component and adds an SVG icon from qwikest/icons, a text, and a simple SVG with a circle to each slot.

After the initial render pass, all contents are rendered in the right slots.

Image

A timeout forces the page to re-render on the client side by adding a .hasTimeout CSS class after a short delay. After the re-render, the named slot still shows the text that has q:slot="red", but the SVG icon and the circle with q:slot="red" are now rendered in the default (green) slot, together with the other (green) content.

Image

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (32) x64 AMD Ryzen 9 7945HX with Radeon Graphics    

    Memory: 4.32 GB / 31.19 GB
  Binaries:
    Node: 18.20.5 - C:\Program Files\nodejs\node.EXE
    npm: 10.8.2 - C:\Program Files\nodejs\npm.CMD
    bun: 1.1.42 - ~\AppData\Local\UniGetUI\Chocolatey\bin\bun.EXE
  Browsers:
    Edge: Chromium (127.0.2651.74)
    Internet Explorer: 11.0.22621.3527
  npmPackages:
    @builder.io/qwik: ^1.12.0 => 1.12.0
    @builder.io/qwik-city: ^1.12.0 => 1.12.0
    typescript: 5.4.5 => 5.4.5
    undici: * => 6.21.1
    vite: 5.3.5 => 5.3.5

Additional Information

No response

@rondonjon rondonjon added STATUS-1: needs triage New issue which needs to be triaged TYPE: bug Something isn't working labels Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
STATUS-1: needs triage New issue which needs to be triaged TYPE: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant