Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[@visx/annotation] Label component has incorrect height in Firefox #1111

Closed
felix-kaestner opened this issue Mar 15, 2021 · 2 comments · Fixed by #1175
Closed

[@visx/annotation] Label component has incorrect height in Firefox #1111

felix-kaestner opened this issue Mar 15, 2021 · 2 comments · Fixed by #1175

Comments

@felix-kaestner
Copy link

Current Behavior
The Label component of the @visx/annotation package has incorrect height in Firefox.

Expected behavior
Label should have correct height.

Environment/Reproduction
URL: https://airbnb.io/visx/annotation
OS: Windows 10

Screenshots

Firefox Version 86.0.1:
image

Edge Version 89.0.774.50 (Chromium):
image

@felix-kaestner felix-kaestner changed the title [Label] Label component has incorrect height in Firefox [@visx/annotation] Label component has incorrect height in Firefox Mar 15, 2021
@WongyuChoi
Copy link

I wonder if there is an update on this issue.

@vovakulikov
Copy link
Contributor

vovakulikov commented Apr 17, 2021

Hey @williaster

To be honest I don't have a clear understanding of this but it seems like react-use-measure doesn't work well with inner svg element within <Text />. 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 even if we put size value from CSS width: 0px, height: 0px) and 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.

My suggestion here, maybe we can move innerRef from text <svg /> element to <text /> element in <Text /> at @visx/text

I hope I will manage to prepare a small PR to check this idea.

сс: @felix-kaestner @WongyuChoi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants