GreedyNav
GreedyNav copied to clipboard
Problem with minimize / maximize browser window
When you open demo (https://codepen.io/lukejacksonn/pen/BowbWE) for example in 700px wide browser window and then you maximize window it doesn't render correctly.
700px browser window
Fullscreen mode (1920x1080)
So it doesn't, does it! I am guessing this happens because entering full screen doesn't trigger a resize event (which it probably should). So the solution will revolve around that thought.
https://stackoverflow.com/questions/34422052/how-to-detect-browser-has-gone-to-full-screen
Do you fancy looking into it further?
First i want to say that codepen demo is outdated.
I've tested code from github too and there is similar error. Resize event is triggering correctly but calculation of available space is wrong because check function is called with no delay. Getting instant state is executed before menu items completely render. Debouncing check and resize event handling can improve performance too.