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.

getStringWidth leaves an empty svg in the document body.

See original GitHub issue

When using Text from @vx/text. The getStringWith function seems to be leaving an empty svg on the body of my document which messes up the document height:

<svg style="width: 0px; height: 0px;"><text id="__react_svg_text_measurement_id">CM</text></svg>

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
loopmodecommented, Sep 19, 2018

For measuring, I usually place elements in negative offscreen using position: fixed and e.g. top: -1000px, never had issues with that. Also, visibility: hidden is better than display: none in such cases because indeed, browser layout algorithms tend to be disabled by display: none altogether, leading to all kinds of quirks.

1reaction
hshoffcommented, Sep 18, 2018

@justnick21 yup will verify before releasing

Read more comments on GitHub >

github_iconTop Results From Across the Web

getStringWidth leaves an empty svg in the document body. #356
The getStringWith function seems to be leaving an empty svg on the body of my document which messes up the document height: C......
Read more >
A created svg element with javascript makes it stuck at 0 width ...
I was working and experimenting with the <svg> element with javascript, wanted to add a new image to it, but it showed nothing....
Read more >
classes-TCPDF
TCPDF PHP class for generating PDF documents without requiring ... $svgclipmode : mixed: Boolean value true when in SVG clipPath tag.
Read more >
TCPDF API documentation - GitHub Pages
TCPDF PHP class for generating PDF documents without requiring external extensions. TCPDF project (http://www.tcpdf.org) has been originally derived in 2002 ...
Read more >
Document Structure — SVG 2
An SVG document fragment consists of any number of SVG elements contained within an 'svg' element. An SVG document fragment can range from...
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