mvasin / react-div-100vh

A workaround for the '100vh' issue in mobile browsers

Home Page:https://react-div-100vh.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

min-height?

joshuarrr opened this issue · comments

Thanks for sharing this component!

For my use I needed to change node.style.height = window.innerHeight + 'px'; to node.style.minHeight = window.innerHeight + 'px';. I don't know how to do this but it seems like passing that down as a prop might be useful?

Hi, Joshua! I'm glad you found it useful.

I think we can pass the component a style object like we would to a normal div, and pass most of it as is to the inner div, except values in vh units. Those we will fix by passing the pixels instead.

Or even better, we can come up with our own unit – 'rvh' (real viewport height). We will suppose that if people supply /^\d+rvh$/ as a value in style object, they mean it.

Do you like the idea? Would you like to make a PR?

Closed by #2.