-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
getComputedStyle does not return the right visibility sometimes #3182
Comments
I am having an issue that I think is related to this same thing. I have a component that sets |
I will make a PR soon, for this issue if it's ok for you @domenic |
@el-ethan I have try my fix with your reproduction repo and it seems to work for your problem too ;) |
Hello guys
Basic info:
Minimal reproduction case
I also made a repository but not sure if it will be useful (because using react + styled-components + testing-library): /~https://github.com/romain-trotard/jsdom-visibility-styled-components-problem
How does similar code behave in browsers?
I just made a screenshot in a browser:
Reason of the problem
I have debugged jsdom and have found where the problem is.
Actually the problem is here:
jsdom/lib/jsdom/living/helpers/style-rules.js
Line 63 in 04f6c13
The reason is that next rules override the value of previous rule.
I have made a fix here /~https://github.com/romain-trotard/jsdom/tree/getCascadedPropertyValue-change
getPropertyValue
returns an empty string "" if the property is not found in the rule (/~https://github.com/NV/CSSOM/blob/97bee0949153ecb3295eccf98da2be79b7269e2f/lib/CSSStyleDeclaration.js#L31)If it's ok with you I can make a PR :)
Thanks
The text was updated successfully, but these errors were encountered: