Skip to content

Top-level Anchor tags break out of the SVG namespace #2048

@titoBouzout

Description

@titoBouzout

Describe the bug

On this example the red square doesn't render
https://playground.solidjs.com/anonymous/81577cd9-1162-4cf9-b312-9b8197bae11b

The underlying issue is that xmlns is lost in at least two situations:

  1. on component change https://playground.solidjs.com/anonymous/133e8b12-defc-4a89-9c42-9cc401b3b602
  2. when reactivity takes over and for example a Show toggles

I believe the only way to fix this is to create a context with the value of the xmlns and use it to create any children. This is not about SVG, this will happen with any XML element/future element that needs the xmlns to work correctly.

Your Example Website or App

https://playground.solidjs.com/anonymous/81577cd9-1162-4cf9-b312-9b8197bae11b

Steps to Reproduce the Bug or Issue

Expected behavior

Screenshots or Videos

Platform

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    wontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions