We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When setting a dynamic class on an SVG Element inside inside like this:
<script> let name = 'world'; </script> <svg> <a href="/" aria-label="..."> <rect class={name} /> </a> </svg>
I get this error on Chrome:
Cannot set property className of #<SVGElement> which has only a getter
https://svelte.dev/playground/hello-world?version=5.14.4#H4sIAAAAAAAAE22NQWrDMBBFrzL8TRJw7b0jG7rLHaIuFHmSGqaykSZuivHdixRCN90-3n9_RXBfjBYnFpnoe4oy0J6HUXk4oMJ1FE5ozyv0Z85eBqheq_d5rtPCopldXOL_uJ-CctCEFib5OM7a22BVWCnr1NGu_O6ONpjmzwgmLbeiGkefka-dRWNBLo7uTdyFpbOo69qiSFZNZK_kxaXUrTm9UfPcN64v7eXWo4LyQ9FqvPP2sf0CorvX0gIBAAA=
Tested in the REPL with:
System: OS: macOS 15.0.1 Browsers: Brave Browser: 131.1.73.101 Chrome: 131.0.6778.140 npmPackages: svelte: 5.14.4 => 5.14.4
blocking an upgrade
The text was updated successfully, but these errors were encountered:
I found a workaround for now:
<svg> <svelte:element this={"a"} {...{ xmlns: 'http://www.w3.org/2000/svg' }} href="/" aria-label="..."> <rect class={name} /> </svelte:element> </svg>
(xmlns is a spread to suppress TypeScript error)
Sorry, something went wrong.
<a>
trueadm
Successfully merging a pull request may close this issue.
Describe the bug
When setting a dynamic class on an SVG Element inside inside like this:
I get this error on Chrome:
Reproduction
https://svelte.dev/playground/hello-world?version=5.14.4#H4sIAAAAAAAAE22NQWrDMBBFrzL8TRJw7b0jG7rLHaIuFHmSGqaykSZuivHdixRCN90-3n9_RXBfjBYnFpnoe4oy0J6HUXk4oMJ1FE5ozyv0Z85eBqheq_d5rtPCopldXOL_uJ-CctCEFib5OM7a22BVWCnr1NGu_O6ONpjmzwgmLbeiGkefka-dRWNBLo7uTdyFpbOo69qiSFZNZK_kxaXUrTm9UfPcN64v7eXWo4LyQ9FqvPP2sf0CorvX0gIBAAA=
Logs
System Info
Tested in the REPL with:
Severity
blocking an upgrade
The text was updated successfully, but these errors were encountered: