Skip to content

SidebarNavHelper.isActive should check child items for dropdowns #67

Closed
@maxtacco

Description

@maxtacco

Hi,

I have a case when urls of child items do not start with the same path as parent's url. In this scenario item selection is not working as expected. So, is it possible to change SidebarNavHelper.isActive to something like this:

public isActive(router, item) {
    const url = item.url;
    if (this.itemType(item) === 'dropdown') {
      if (url === '' || url === '#') {
        return item.children.some((childItem: any) => this.isActive(router, childItem));
      } else {
        return router.isActive(url, false);
      }
    } else {
      return router.isActive(url, true);
    }
  }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions