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

Spread operator doesn't work in SVG elements #3522

Closed
kpjava opened this issue Sep 6, 2019 · 1 comment · Fixed by #3531
Closed

Spread operator doesn't work in SVG elements #3522

kpjava opened this issue Sep 6, 2019 · 1 comment · Fixed by #3531
Labels

Comments

@kpjava
Copy link

kpjava commented Sep 6, 2019

Describe the bug
When trying to fill in various attributes of an SVG element using the spread operator I get a read-only error. This seems like it might be related to the closed issue of #1664. If I explicitly set the attributes from an object, the SVG element renders just fine.

Failing script: https://svelte.dev/repl/a9c3d921ed4e4ab7923d64d30ed3a497?version=3.9.2

A similar script that works: https://svelte.dev/repl/62e182c229f24c2ea5bd77d307de266f?version=3.9.2

Logs
When I try the failing script above, I get this error: Cannot assign to read only property 'x' of object '#<SVGRectElement>'

Severity
I am trying to use Svelte to work with dynamic SVG elements, so this is a major blocker.

@Conduitry
Copy link
Member

Also potentially related to #2732.

@Rich-Harris Rich-Harris added the bug label Sep 7, 2019
Rich-Harris added a commit that referenced this issue Sep 8, 2019
only use setAttribute with SVG spread props
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.

3 participants