Comments (7)
I was able to workaround this for my Surplus demo tomorrow with:
const svgClass = { class: $style.callout__quotation } //...
<svg
version="1.1"
{...svgClass}
x="0px"
y="0px"
viewBox="0 0 48 42.1"
>
😄
from surplus.
Hmm, good catch. Looks like the HTML-friendly property aliases, which translate class -> className, are firing for SVG too, which they shouldn't. In fact, they should probably fire in reverse, translating className -> class, since we set attributes, not properties, on SVG nodes.
Have to think about this one. There's a quick fix which will get almost all the SVG tags but not all. The ones it would miss would be the tags which are common to both SVG and HTML, like , <title>, etc. To get them, I have to add a little more context to the translation layer. I'd like to make a 100% fix for this.
from surplus.
@adamhaile No worries, there's no hurry, I can use the workaround for now.
from surplus.
Whaa? I tried to reply to your workaround and ended up editing it.
Was trying to say that you can also use a small fn to set the class for the time being:
<svg
version="1.1"
fn={el => el.setAttribute("class", $style.callout__quotation)}
x="0px"
y="0px"
viewBox="0 0 48 42.1"
>
from surplus.
@adamhaile Ah, that's also cool. I'll save that for next time!
from surplus.
Should be fixed with 5ceff5b .
from surplus.
Unit tests are passing now, so closing this issue. Let me know if you have any other problems with it!
from surplus.
Related Issues (20)
- Cannot set style attribute by string HOT 2
- input's "list" attribute HOT 1
- template tag function? HOT 13
- SArray.slice() versus slicing the update value HOT 1
- Fragments? HOT 7
- add and enable Travis CI
- Getting a circular dependency warning with Rollup HOT 5
- Emoijs aren't encoded correctly HOT 4
- Question: Surplus + TypeScript - debugging experience (issue with source maps?) HOT 5
- Not compatible with S.subclock HOT 2
- Basics of Surplus Array rendering HOT 5
- `transform` CSS property not working HOT 1
- Proposal for attribute+signal shorthand HOT 14
- Attribute spread and fn don't work HOT 3
- Compiler chokes on regular expression literal HOT 3
- svg xlink support? HOT 2
- Missing support for dynamic/string-based tags HOT 3
- Support for arrays in className HOT 4
- reconcileArrays fails on parent.insertBefore
- Rewriting default examples to avoid the error "computations created without a root or parent will never be disposed"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from surplus.