question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add SVG support to snabbdom

See original GitHub issue

Continuing discussion from tsers-js/snabbdom#2

Nice observations here from @laszlokorte:

I just tried to create my first TSERS component using SVG.

https://gist.github.com/laszlokorte/2a9ae0accca2805bde3eb28c376fd660#file-tsers-component-js-L11-L13

The width and height attributes of the svg tag itself get set but the cx, cy and r attributes of the circle tag are not set.

I think the reason is this check: https://github.com/tsers-js/snabbdom/blob/master/src/index.js#L104-L107 which tries to unify snabbdoms props and attrs options.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
pmroscommented, May 23, 2016

It works OK with ReactDOM driver. Thank you for TSERS!

0reactions
milankinencommented, May 9, 2016

I like the idea of setting namespace recursively to the children of svg node. Currently TSERS DOM implementation don’t support embedded observables in vnodes but even with that, I think there is still a way to add namespace afterwards.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add svg support · Issue #4 · snabbdom/snabbdom - GitHub
DOM element creation is handled by the core. And there is currently no way the core can create namespaced elements (easily fixable). I've...
Read more >
snabbdom - npm
A virtual DOM library with focus on simplicity, modularity, powerful features and performance.. Latest version: 3.5.1, last published: 6 ...
Read more >
<text> - SVG: Scalable Vector Graphics - MDN Web Docs
The SVG element draws a graphics element consisting of text. It's possible to apply a gradient, pattern, clipping path, mask, ...
Read more >
JSX Cheatsheet - ServiceNow Community
Each property represents a class you want to add to the element and it will be added ... Fragment element to the rescue...
Read more >
snabbdom/snabbdom - Gitter
@paldepind Awesome thanks. BTW does Snabbdom support embedding a tree in an element, for example document.body even if this element's contents can ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found