Opened 7 weeks ago
Last modified 7 weeks ago
#65961 new defect (bug)
Mobile Navigation Problem with WordPress 7.1
| Reported by: | grafmahardi | Owned by: | |
|---|---|---|---|
| Priority: | high | Milestone: | Awaiting Review |
| Component: | Menus | Version: | 7.1 |
| Severity: | major | Keywords: | needs-patch |
| Cc: | Focuses: |
Description (last modified by )
English (Google Translate)
Title:
Mobile Navigation: All submenus appear permanently open (WordPress 7.1). Simple overlay
Description:
After updating to WordPress 7.1, all navigation submenus appear permanently open in the mobile view when the hamburger menu is opened.
Behavior:
- Desktop: Works correctly
- Mobile (< 782px): When the hamburger menu is opened, all submenus become visible and remain open
- Clicks on submenu items work, but all submenus are visible simultaneously
Cause:
The element .wp-block-navigation__submenu-container has the attribute data-wp-on--focus="actions.openMenuOnFocus". The Interactivity API opens all submenus simultaneously instead of controlling them individually.
(Original German)
Titel:
Mobile Navigation: Alle Submenüs werden permanent geöffnet angezeigt (WordPress 7.1). Einfaches Overlay
Beschreibung:
Nach Update auf WordPress 7.1 werden in der mobilen Ansicht alle Submenüs der Navigation permanent als geöffnet angezeigt, wenn das Hamburger-Menü geöffnet wird.
Verhalten:
- Desktop: funktioniert korrekt
- Mobile (< 782px): Beim Öffnen des Hamburger-Menüs werden alle Submenüs sichtbar und bleiben offen
- Klicks auf Submenü-Items funktionieren, aber alle sind gleichzeitig sichtbar
Ursache:
Das Element .wp-block-navigation__submenu-container hat das Attribut data-wp-on--focus="actions.openMenuOnFocus". Die Interactivity API öffnet alle Submenüs gleichzeitig, statt sie individuell zu steuern.
Theme: Twenty-Twenty-five and Own Child-Theme
Browser: [Chrome Mobile]
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Thanks for reporting this!
I was involved in the related issues, and i think the issue stems from how
isSubmenuOpenis computed in the Navigation block's Interactivity API store, See navigation/view.js for full contextAlso see related - GB #76658, somewhat related GB #63033
As much as I've looked into this, I think simplest thing to do is to decouple isSubmenuOpen from isOverlayOpen, which will allow submenus to stay collapsed by default and open individually when tapped.
Since this logic lives in @wordpress/block-library precisely here, I think this discussion would be much more suited there Gutenberg issues