-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
SVG viewBox attribute is incorrectly applied #177
Comments
Thanks for the detailed bug report! I'm thinking it's failing to set the property but the error is being caught and suppressed. I can't check now, but maybe it's fixed in https://npmcdn.com/preact@beta ? |
Awesome. Will check in the morning and let you know |
@marklundin This ended up being a bug in preact-svg. It's now fixed, released as |
Great work @developit ! |
marvinhagemeister
added a commit
that referenced
this issue
Mar 15, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When a component renders different svg elements depending on it's state, it will incorrectly apply the viewBox attribute from the first svg element rendered to the second.
Test case : https://jsfiddle.net/jdqhus9m/
viewBox="50 0 50 50"
attribute displaying a green rect.viewBox="50 0 50 50"
attribute from the first render.Expected result: SVG element should have no viewBox attribute and should display the red and greenbox side by side.
The text was updated successfully, but these errors were encountered: