-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Attributes with values like "20vw" get converted incorrectly #234
Comments
Hope, that you never encounter an input with leading zero … that is, better pass |
@Ryuno-Ki That's not a thing for |
Looking it up on MDN and you're right. |
Either way, we're using isNaN now |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sample repo: https://github.com/PaulBGD/svelte-pass-number
Basically comes down to this line of code:
svelte/src/generators/dom/visitors/attributes/addComponentAttributes.js
Line 31 in 7cd8683
Attributes that start with a number like
<Comp value="10px"
gets parsed into the number10
byparseFloat
so it outputs it asI suggest replacing the isNaN check with
or something that better checks if it's a number or not.
The text was updated successfully, but these errors were encountered: