Recently, I put together a compact menu using tailwindcss which is functioning well. However, there seems to be an issue when this menu is viewed on mobile devices, as the user ends up scrolling the content underneath the menu instead of the menu itself. This causes some menu items to disappear off-screen.
To illustrate this problem, I have created a CodePen demonstration:
Here's the link to the demonstration
This is how I set the fixed position for the menu:
<div class="bg-gray-500 md:flex md:justify-between md:items-center md:px-4 md:py-3 w-full z-50 top-0 fixed">
<div class="flex items-center justify-between px-4 py-3 md:p-0">
[...]
</div>
</div>
I've also prepared a gif demonstrating the issue - simply click on the image below to view the animation:
https://i.sstatic.net/gYjWG.gif
It's unclear to me why this behavior is occurring. My suspicion is that there may be an error in how I implemented the fixed positioning. Any assistance would be greatly appreciated, as my objective is to create a scrollable and fixed menu for mobile devices.