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.

Unable to create svg elements with CSS selectors

See original GitHub issue

Something like this never works —

h('line.form-field-underline-default', {attrs: {x1: '0', y1: '0', x2: '100', y2: '0'}})

ERROR:

Uncaught TypeError: Cannot assign to read only property 'className' of object '#<SVGLineElement>'
    at createElm (snabbdom.js:75)
    at createElm (snabbdom.js:78)
    at createElm (snabbdom.js:78)
    at createElm (snabbdom.js:78)
    at createElm (snabbdom.js:78)
    at updateChildren (snabbdom.js:172)
    at patchVnode (snabbdom.js:212)
    at updateChildren (snabbdom.js:151)
    at patchVnode (snabbdom.js:212)
    at updateChildren (snabbdom.js:151)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
tusharmathcommented, Jan 8, 2017

IMHO a selector should just work everywhere don’t u think? This is an implementation detail that as a consumer of the library, I shouldn’t be concerned about. I’d be happy to send a PR for it.

0reactions
caesarsolcommented, Apr 18, 2017

Ok thanks! Sending the PR in a few hours.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is the :hover selector not working on this SVG element?
When I use the selector #apple:hover to select an SVG element, the hover doesn't seem to be working. Why is this not working?...
Read more >
Targeting SVG icons with CSS not working in Webkit
I'm working on a project that uses some SVG icons that I'd like to be able to style with css for different scenarios...
Read more >
Selectors - WebdriverIO
The WebDriver Protocol provides several selector strategies to query an element. WebdriverIO simplifies them to keep selecting elements simple.
Read more >
Select Page Elements | Basic Guides - TestCafe
To interact with the page, use test actions. Create Selectors. Pass a CSS selector string or a client-side function to the Selector constructor...
Read more >
SVG and CSS - SVG: Scalable Vector Graphics | MDN
Make a new SVG document as a plain text file, doc8.svg . ... complex CSS selectors on elements referenced via <use> elements, at...
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