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
TypeError: value.match is not a function #612
Labels
Comments
capricorn86
added a commit
that referenced
this issue
Oct 11, 2022
…han string to CSSStyleDeclaration properties, causing the property parser to crash.
capricorn86
added a commit
that referenced
this issue
Oct 11, 2022
…h-is-not-a-function #612@patch: Fixes issue related to sending in other types of values t…
Thank you for reporting @smarlhens and @kalvenschraut! 🙂 I have fixed the problem now. You can read more about the release here: |
What should happen in the browser is the following (this is also what you will get in Happy DOM): var element = document.createElement('div');
element.style.top = 2;
element.style.opacity = 0.2;
// Outputs "" (empty string)
console.log(element.style.top);
// Outputs "0.2"
console.log(element.style.opacity); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi there 👋🏻
Describe the bug
I'm getting value as
number
instead ofstring
in getTop (and I guess I can also getnumber
in other functions likegetLeft
,getRight
, etc).It's maybe because property value I get from headlessui hidden fragment are not valid values (e.g.
top: 1
) but we should replace them by0px
I guess (that's what I get when I try usingjsdom
, all the values are replace with0px
).Maybe we should return
0px
if value is not a string as expected ?Only
0
is a valid numeric fortop
and is equal to0px
;References:
To Reproduce
Reproduction repo: https://github.com/smarlhens/happy-dom-value-match-is-not-a-function
Expected behavior
Not getting error in unit test 😄
Device:
The text was updated successfully, but these errors were encountered: