Skip to content

Navigation Link block uses incorrect classname for nested submenu #21444

@talldan

Description

@talldan

Describe the bug
The Navigation block uses a Navigation Link inner block and each Navigation Link can also have child Navigation Links to create sub-menus, e.g.:

- Navigation
  '- Navigation Link
      '- Navigation Link

However when building a deeply nested navigation block and checking the class names used in a post, an incorrect wp-block-navigation__container class is used within wp-block-navigation-link:
Screenshot 2020-04-07 at 1 07 54 pm

This can also be seen in the Navigation Link's edit function where an incorrect wp-block-navigation__container class is used:
https://github.com/WordPress/gutenberg/blob/master/packages/block-library/src/navigation-link/edit.js#L300

This should be easier to solve in both places once #21075 is merged.

To reproduce
Steps to reproduce the behavior:

  1. Build a deeply nested navigation block
  2. Preview the post
  3. Observe the incorrect class names when inspecting a nested menu

Expected behavior
The wp-block-navigation__container should be changed to wp-block-navigation-link__container.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions