souporserious / get-node-dimensions

Get accurate element dimensions, even if it's hidden!
MIT License
20 stars 5 forks source link

Use style from the original node, not the clone #2

Closed miracle2k closed 8 years ago

miracle2k commented 8 years ago

In my case (Chrome), getComputedStyle(clone) was completely empty, but getComputedStyle(node) gave the correct information.

souporserious commented 8 years ago

Thanks for this!

souporserious commented 8 years ago

Sorry, I reverted this without realizing what I was doing. My tests weren't passing so I thought we still needed to measure the clone. But then I realized I wasn't accounting for the display property right.