-
Notifications
You must be signed in to change notification settings - Fork 37
Closed
Labels
Description
📄 Description
When the hamburger menu is opened in mobile view and the screen is then resized to desktop view (lg: and above), the mobile menu remains visible on top of the desktop layout. This causes overlapping and layout issues.
🔍 Steps to Reproduce
- Open the app on a mobile screen (or resize to mobile view)
- Click the hamburger menu to open the mobile menu
- Resize the window to desktop width (≥ 1024px)
- ❌ Mobile menu stays open, overlapping desktop navbar
📱 Screenshot / Video (if any)
✅ Expected Behavior
- The mobile menu (
isMobileMenuOpen) should automatically close when screen size transitions to desktop - Desktop layout should render without overlapping mobile components
💡 Suggested Solution
- Add a
window.resizeevent listener to automatically setisMobileMenuOpen = falsewhen width ≥ 1024px - Clean up the event listener on unmount
🙏 Additional Notes
This issue commonly occurs in responsive React apps using Tailwind and fixed navbars. Fixing it improves cross-device consistency.
Assign this issue to me
Reactions are currently unavailable