Skip to content

Navigation block's "Open on click" does not work for nested submenus #60738

@daviedR

Description

@daviedR

Description

The "Open on click" mode in the Navigation block fails to keep the submenu when switching from an opened submenu to the other submenu.

Please watch the screen recording.

Step-by-step reproduction instructions

  1. Edit (or create) a page.
  2. Create a core/navigation block.
  3. Enable this option: Setting (tab) > Display (panel) > Submenus > "Open on click".
  4. Populate menu items as follows:
Top Level Menu Item
    1. Submenu item
        1.1. Nested Submenu Item
        1.2. Nested Submenu Item
    2. Submenu item
        2.1. Nested Submenu Item
        2.2. Nested Submenu Item
  1. Save the page and view the page.
  2. Click the Top Level Menu Item and then click the 1. Submenu Item, and then click the 2. Submenu Item.
  3. The whole menu will be closed, which is not the expected behavior. The menu should still be opened with the 1. Submenu Item closed and 2. Submenu Item opened.

Screenshots, screen recording, code snippet

navigation--open-on-click-bug.mp4

Environment info

  • WordPress 6.5.2
  • Theme: Twenty Twenty Fourteen
  • Gutenberg 18.1.0 (bug also occurs without Gutenberg)

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions