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
How do I get the correct width of my component? #1940
Comments
Are you using jsdom? I believe this is a known limitation of jsdom - the clientHeight is zero because it's not actually visible. |
I know , but in some scenarios, I just want to test the height of a node, for example, I have some image, the height of each image is fixed, I want to find the wrong size image when all pictures have same width . |
Then it seems like you'd need to test it in an actual browser, and not using jsdom - this doesn't seem related to enzyme. |
All right,Maybe I should change the way to solve this problem. |
FYI jsdom/jsdom#135 is the relevant issue in jsdom where offsetWidth/Height, etc. are not yet supported. There is a kludgy workaround presented in that thread that seems to have helped some people, but I say there be demons in that approach. |
I have a similar problem to #1525
but it is dosen't work #1525 (comment)
my code:
Current behavior
dom1 .clientHeight = 0
Expected behavior
dom1 .clientHeight = 10
Your environment
windows
API
Adapter
The text was updated successfully, but these errors were encountered: