Skip to content
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

height is sometimes wrong when browser height shrinks #51

Open
cinnabarcaracal opened this issue Dec 22, 2020 · 2 comments
Open

height is sometimes wrong when browser height shrinks #51

cinnabarcaracal opened this issue Dec 22, 2020 · 2 comments

Comments

@cinnabarcaracal
Copy link

cinnabarcaracal commented Dec 22, 2020

When I shrink the website height by resizing my browser (Chrome Desktop Version 87.0.4280.88) the height (output of the measureHeight function) is sometimes too small by 15px.

This means a 15px tall white bar along the bottom of my site flicks into and out of existence as I shrink the browser.

As I drag the bottom of the window up, every 2nd call to measureHeight returns the incorrect value.

There is no issue when increasing the window height.

The odd thing is if I stop resizing the window once I get a bad value, and then use the console to get the documentElement.clientHeight, I get the correct value. It's almost like the browser hasn't updated the documentElement.clientHeight when measureHeight runs, but then it does so right after.

This does not happen when I activate the device toolbar, switch it to responsive and shrink the height there.

Does anyone else have this issue? I'm not sure if it is a browser bug, something in this library or most likely just something odd with my site.

@alex-cory
Copy link

I'm pretty sure this also affects when the keyboard is opened the height will be incorrect.

@mvasin
Copy link
Owner

mvasin commented Nov 7, 2021

Hi @cinnabarcaracal! I released this change https://github.com/mvasin/react-div-100vh/pull/74/files as [email protected]. Chances are it will help. Can you try it out?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants