question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SidebarNavHelper.isActive should check child items for dropdowns

See original GitHub issue

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);
    }
  }

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:16 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
xidedixcommented, Jan 21, 2020

@WolfgangVonL @kafo85

v2.7.4 adds SidebarNavHelper to the public-api surface, you can safely:

  • import
import { SidebarNavHelper } from '@coreui/angular';
  • extend
export class AppSidebarNavHelper extends SidebarNavHelper {
  ...
}
1reaction
xidedixcommented, Jan 23, 2020

@WolfgangVonL

This feature will be available as an option in the upcoming CoreUI v3 for Angular.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JQuery dropdown menu, how to show child-items when ...
If you want jQuery to show the sub navigation for the current item you can check for the class on the sub navigations...
Read more >
Dropdowns
They're made interactive with the included Bootstrap dropdown JavaScript ... ARIA menus can only contain menu items, checkbox menu items, radio button menu ......
Read more >
Dropdown
dropdown -item each single item of the dropdown, which can either be a a or a div; dropdown-divider a horizontal line to separate...
Read more >
Dropdown | Components
Now you can optionally create <button> elements in your dropdowns by using the <b-dropdown-item-button> sub-component. <b-dropdown-item-button> does not ...
Read more >
"Find Children" "Select Item" from a drop down list - Help
Hello Everybody, Currently I'm trying to download data from “Agriculture Marketing” this website. Where first I have to select commodity ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found