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

Dropdown depth not auto-calculating #2

Open
jet-agency opened this issue Jun 28, 2021 · 2 comments
Open

Dropdown depth not auto-calculating #2

jet-agency opened this issue Jun 28, 2021 · 2 comments

Comments

@jet-agency
Copy link

Dropdown depth in menus is not auto-calculating and as a result, parent anchor links are not giving IDs or aria labels. If I manually specify a depth in arguments, the nav works as intended. Working example:

    public function primarymenu() {
      $args = array(
        'theme_location'    => 'primary_navigation',
        'menu_class'        => 'navbar-nav',
        'fallback_cb' => '__return_false',
        'depth' => 2,
        'walker'            => new \App\wp_bootstrap5_navwalker()
      );
      return $args;
    }

Using Sage 5 with the following branch to extend BS5 - https://github.com/strarsis/sage/tree/webpack5-bootstrap5

@GarrettWeinberg
Copy link
Owner

@jet-agency I can add a default depth, but you are correct that you need to set a depth. Ill work on setting a default depth, but for now ill update the readme to reflect this.

@jet-agency
Copy link
Author

@GarrettWeinberg Cool, thanks! Great walker otherwise.

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

2 participants