KyleAMathews / react-headroom

Hide your header until you need it
https://kyleamathews.github.io/react-headroom
MIT License
1.84k stars 149 forks source link

CalcHeightOnResize not working for non-window parent #166

Open elitenoire opened 5 years ago

elitenoire commented 5 years ago

I'm using a parent other than the window object and noticed the inline height is not calculated when resizing the browser window.

React-Headroom attaches the resize event handler to the parent prop but I've read that the resize event fires only on the window.

Hence, I implemented this (attached a resize handler to the window object) in my code base and the inline height gets recalculated.

The problem now is that, React-Headroom overrides the height style set in the wrapperStyle prop, so no way to use the new height.