wp-bootstrap / wp-bootstrap-navwalker

A custom WordPress nav walker class to fully implement the Twitter Bootstrap 4.0+ navigation style (v3-branch available for Bootstrap 3) in a custom theme using the WordPress built in menu manager.
https://wp-bootstrap.github.io/wp-bootstrap-navwalker/
GNU General Public License v3.0
3.37k stars 1.94k forks source link

Double Click required for dropdowns #464

Closed jgreen84 closed 3 years ago

jgreen84 commented 4 years ago

Hi. I have used this class many times and on a handful of occasions I have had this problem.

I have implemented my menu exactly as the example shows:

<?php wp_nav_menu(array(
    'theme_location'    => 'primary',
    'depth'             => 2,
    'container'         => 'div',
    'container_class'   => 'collapse navbar-collapse justify-content-end',
    'container_id'      => 'navbarNav',
    'menu_class'        => 'nav navbar-nav',
    'fallback_cb'       => 'WP_Bootstrap_Navwalker::fallback',
    'menu_id'           => 'main-menu',
    'walker'            => new WP_Bootstrap_Navwalker(),
)); 
?>

However, if there's a drop down, the link requires two clicks to open that dropdown. There are no console warnings and in the Inspector I can see the li class flash and change (to exactly the same string of classes it already had), and the the a's "aria-expanded" flash and change to false (which it also already is). On the second click, "show" is appended to the the li classes and aria-expanded for the a is toggled to true. Then the menu displays as you would expect.

This requirement for a second click is obviously not desired functionality.

As no-one else has mentioned this I'm assuming I have messed up somewhere but I've rewritten this menu several times to try and cure it and no luck. I also can't see any difference between this code and the code I have on another site where it doesn't happen.

Any suggestions very welcome at this stage.

Thank you

IanDelMar commented 3 years ago

@jgreen84 Do you still have this issue?

jgreen84 commented 3 years ago

@IanDelMar I haven't even looked back at this, I found an alternative, but yes, theoretically I'm still having that problem if I go back to the standard setup. I forget what I did as a workaround, I possibly had to build the menu manually instead of using the walker.

IanDelMar commented 3 years ago

I can't reproduce this issue. Could you please provide more details about your setup (WP version, Walker version, etc.) and which browsers you have checked? Thank you!

IanDelMar commented 3 years ago

I'm closing this due to lack of feedback. Feel free to re-open the issue providing more details about your setup if the problem persists.