GreedyNav icon indicating copy to clipboard operation
GreedyNav copied to clipboard

Problem with minimize / maximize browser window

Open luboslav opened this issue 7 years ago • 2 comments

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 greedy-nav-700px

Fullscreen mode (1920x1080) greedy-nav-fullscreen

luboslav avatar Nov 29 '17 14:11 luboslav

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?

lukejacksonn avatar Nov 29 '17 15:11 lukejacksonn

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.

luboslav avatar Nov 29 '17 19:11 luboslav