Skip to content

Doc site > duplicate ids in nested sidebar navigation

Description of Issue

On the Pajamas Design System doc site, the sidebar has 12 ids that are repeated: "item-undefined" These ids are tied to the aria-controls attribute for nested category navigation menus (so, 24 occurrences of item-undefined total).

screenshot shows 24 occurrences of "item-undefined" on the doc site, indicating there are 12 ids with the same value and 12 "aria-controls" attributes with the same value.

The issue appears to be related to how the itemId for the sidebar's menu_items (which populates the id and aria-controls attributes for each nav category) relies on a path value for each item. However, at least 12 items do not have a path (hence, "undefined" in the itemId) because they are categories without standalone pages.

Proposed Solution

Category menu_items (which don't have their own standalone pages) could have a valid itemId without relying on a path. I can propose an MR for this.