Kevin Powell - CommunityKP-C
Kevin Powell - Communityโ€ข3mo agoโ€ข
21 replies
Tok124 (CSS Nerd)

Responsive Navbar toggles automatically when resizing viewport

So, i have had this issue for a rather long time, i always come across this issue every time i make a navbar and i just never been able to find a solution to this...

So, when i resize the viewport, the menu should be hidden and the hamburger button should appear, but when i resize, it shows the navbar for like 0.5 seconds and then it instantly closes.

i am using interpolate-size: allow-keywards; to transition between height: 0; > height: auto;
i am also using transition-behavior: allow-discrete; to allow discrete animations (display:none; > display:block;)
and i am also using @starting-style.

Here is my code

i also add a video below to also show the issue.
CodePenTim
...
Untitled
Was this page helpful?