This repository has been archived by the owner on Sep 30, 2024. It is now read-only.
Fix chart label in Firefox for code insight pie chart #20120
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: https://github.com/sourcegraph/sourcegraph/issues/20084
I consider this problem came from how Firefox treats empty svg elements without width and height within another svg element with height and width - They usually have
width=100%
height=100%
of parent size even if we put size value from CSSwidth: 0px; height: 0px;
explicitly.In the first render we're getting a really big value of Text svg height, so we're just stuck with this big initial height value here and therefore have this visual behaviour here.
Possible solution in this PR this is replace
innerRef
target from svg<Text />
root element to<text />
element which can be measured without this problem.Problem is Text component comes from @visx/text package. Just not to be blocked by this fixes inside visx packages. I forked this component and added this fix with
innerRef
. But we have to pull origin component when this problem will be resolved at visx codebase.