Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-Level Nested Navigation is missing in react-minimal-side-navigation #28

Open
pritamkumarshahi opened this issue Oct 4, 2024 · 0 comments

Comments

@pritamkumarshahi
Copy link

Description:

The react-minimal-side-navigation library does not correctly render or handle multi-level nested navigation items. While the library allows for basic nested navigation, it fails when attempting to display or interact with items that are more than one level deep (i.e., items with children that also have children).

Steps to Reproduce:
Create a navigation structure with multiple levels of nesting:

const navigationData = [
  {
    title: "Dashboard",
    itemId: "/dashboard",
  },
  {
    title: "Products",
    itemId: "/products",
    children: [
      {
        title: "Electronics",
        itemId: "/products/electronics",
        children: [
          {
            title: "Laptops",
            itemId: "/products/electronics/laptops",
          },
          {
            title: "Phones",
            itemId: "/products/electronics/phones",
          }
        ]
      }
    ]
  }
];

Pass the data to SideNav:

<SideNav
  items={navigationData}
  onSelect={(selected) => {
    console.log(selected);
  }}
/>

Notice that the second level of navigation (e.g., Laptops, Phones) is either not rendered, inaccessible, or not interactive.

Expected Behavior:
The component should allow for deeper levels of nested navigation, rendering each level correctly and maintaining interactivity for all items.

Actual Behavior:
The second level of navigation does not render properly, or the children of nested items are not accessible.

Environment:
Library Version: react-minimal-side-navigation 3.x.x
React Version: 17.x / 18.x
Browser: Chrome / Firefox / Safari

Additional Context:
This issue limits the usability of the library for applications that require more complex navigation structures.
No errors are thrown in the console, but navigation beyond one level deep is broken.

Possible Solution:
Add recursive rendering support for nested children in the navigation items.
Ensure that all levels of nested items are rendered dynamically based on the depth of the children array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant