Closed tleunen closed 7 years ago
It looks like the const getElementHeight = el => el.clientHeight; ignores both padding and margin specified in css on the initial render.
Have you experienced this during the update of react-collapse @nkbt ? I see you removed react-height as dependency in your upcoming version. But you are still using clientHeight here.
Yep it foes ignore margins and paddings. That is intentional.
Collapse does not use react-height since v3 anymore.
Example was not upgraded yet
Thank you for answering so fast @nkbt! 👍 Does react-collapse v3 include paddings and margin on initial render? From what i can see it uses the same logic here .
I was wondering if you ever tested performance of the collapse solution without react-motion only specifying height and using css transition?
Best regards
Nope it does not do it either. By choice again. I dont want to solve css height problems at all. If you use collapse, make sure tour element is not affected by padd/marg. Style children elements or containers instead.
Css should be faster, tho never tested, but it does not solve give enough flexibility
This page http://nkbt.github.io/react-height/example/ shows an initial height of 18px.![screen shot 2017-01-25 at 8 36 46 pm](https://cloud.githubusercontent.com/assets/1972567/22316864/09730312-e33e-11e6-9106-c25bafe6408f.jpg)
But in reality, the content height for a paragraph is
70px
, while the block is152px
.The
onHeightReady
doesn't seem to be called on the first render, and I'm having the same issue in my app as well...