Skip to content
This repository was archived by the owner on Feb 9, 2026. It is now read-only.
This repository was archived by the owner on Feb 9, 2026. It is now read-only.

Navigation Component: Duplicate IDs when using multiple instances  #141

Description

@jacobdubailcadmv

Describe the bug
When implementing multiple instances of the Navigation component on the same page, duplicate IDs will be present in the DOM, leading to validation/a11y errors. https://github.com/10up/component-library/blob/develop/packages/navigation/src/navigation.js#L205 uses the loop's index to set the ID.

To Reproduce
Steps to reproduce the behavior:

  1. Instantiate multiple navigation components on the same page
  2. Inspect the submenu IDs, e.g. "tenUp-submenu-0"

Expected behavior
The unique IDs should be generated using the uuid package or the window.crypto.randomUUID() method, or the Navigation class should allow passing in an ID prefix.

Additional context
My use case: I'm using the Navigation component for the main/primary navigation, as well as for navigation blocks in the editor.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions