Skip to content
This repository has been archived by the owner on Dec 10, 2021. It is now read-only.

fix(dimension): set width=0, height=0 in createHiddenSvgNode #261

Merged
merged 1 commit into from
Nov 20, 2019

Conversation

williaster
Copy link
Contributor

@williaster williaster commented Nov 20, 2019

🐛 Bug Fix
This fixes an issue in @superset-ui/dimensions where the hidden svg used for text measurement has a non-zero width/height, and can result in the svg affecting layout even though it has position: absolute. In our case this actually causes an infinite measurement loop where

  1. the svg is added, resulting in a browser scroll bar
  2. the svg is removed, making the scroll bar go away
  3. the screen width change in 2) from the scroll bar going away triggers the ResizeObserver of a parent component, updating the chart and goes back to 1)

I updated it to mirror what we have in @vx/text which was fixed here.

@kristw

@williaster williaster requested a review from a team as a code owner November 20, 2019 19:41
@kristw kristw changed the title fix: set width=0, height=0 in createHiddenSvgNode fix(dimension): set width=0, height=0 in createHiddenSvgNode Nov 20, 2019
@codecov
Copy link

codecov bot commented Nov 20, 2019

Codecov Report

Merging #261 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #261   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files         104    104           
  Lines        1230   1234    +4     
  Branches      296    296           
=====================================
+ Hits         1230   1234    +4
Impacted Files Coverage Δ
...perset-ui-dimension/src/svg/createHiddenSvgNode.ts 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1c7f019...9059f4b. Read the comment docs.

@netlify
Copy link

netlify bot commented Nov 20, 2019

Deploy preview for superset-ui ready!

Built with commit 9059f4b

https://deploy-preview-261--superset-ui.netlify.com

@kristw kristw merged commit 7170f48 into master Nov 20, 2019
@delete-merged-branch delete-merged-branch bot deleted the chris--dimensions-svg-style-fix branch November 20, 2019 19:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants