bootstrap-5-wordpress-navbar-walker icon indicating copy to clipboard operation
bootstrap-5-wordpress-navbar-walker copied to clipboard

Level 2 Item not showing if it has children at level 3.

Open asifpix opened this issue 4 years ago • 29 comments

Hello Alex, Hope you are doing well. I have encountered an issue today.

If you have any 3rd level menu item then it's immediate parent item will not show. To get understand the issue I have attached 2 screenshots. On 2nd screenshot of front-end you can see that, the "Level 2" menu item is not showing because of it has children. "Level 2a" and "Level 2b" are showing properly because of they don't have any children items.

Screenshot_1 Screenshot_2

I have fixed the issue already on my side.

Best Regards Asif

asifpix avatar Oct 02 '21 07:10 asifpix

having same issue - it is because of the dropdown menu css class being display: none

attempting to find a fix

DrogoNevets avatar Nov 12 '21 16:11 DrogoNevets

I'll take a closer look in the near future, but if you're still having issues, there's a small hotfix for customers/admins to not mess up the menu by hooking into nav-menus.php.

Kemal-Sulic avatar Nov 14 '21 02:11 Kemal-Sulic

@asifpix Feel free to create a pull request with the fix. I will not fix this because it's not a bug for the scope of the project since Bootstrap 5 doesn't support 3 levels menu.

AlexWebLab avatar Nov 15 '21 02:11 AlexWebLab

@AlexWebLab I can create a fix, however needs JS and CSS is this ok?

DrogoNevets avatar Nov 23 '21 14:11 DrogoNevets

@AlexWebLab I can create a fix, however needs JS and CSS is this ok?

Yeah you can share. Maybe I'll make a branch for that.

AlexWebLab avatar Nov 24 '21 03:11 AlexWebLab

Having same issue whereby third level isn't displaying as depicted above, is there a fix for this yet?

beshealthcare avatar Mar 03 '22 15:03 beshealthcare

I am still working on this amongst my day job. It is probably good enough tbh - but want to have a little play around more

I am using it here if you are happy with that I can create a fork and PR and see what @AlexWebLab thinks, but need to think about the package for it a little too

DrogoNevets avatar Mar 03 '22 15:03 DrogoNevets

Hi @DrogoNevets - Your version seems to achieve the desired effect, so I would be more than happy to use that over what I have. The only thing i'd change for my personal requirement is to have the menu's open on mouseover rather than click on desktop, with open on click for mobile.

I still can't understand why Bootstrap and Wordpress can't work together to fix this issue.

beshealthcare avatar Mar 03 '22 15:03 beshealthcare

I am away over the weekend, will try and start the packaging and PR process by next weekend for everyone

DrogoNevets avatar Mar 03 '22 15:03 DrogoNevets

I am still working on this amongst my day job. It is probably good enough tbh - but want to have a little play around more

I am using it here if you are happy with that I can create a fork and PR and see what @AlexWebLab thinks, but need to think about the package for it a little too

I'm totally okay but NOT with open on hover.

AlexWebLab avatar Mar 05 '22 08:03 AlexWebLab

@DrogoNevets any progress? I've also run into a use case that could use this fix.

justinb40 avatar Mar 28 '22 21:03 justinb40

Hello @AlexWebLab

I have created a pull request with the fix.

asifpix avatar Apr 02 '22 07:04 asifpix

To avoid breaking anything in the current implementation (following Bootstrap design) , after a big effort I came up with a solution ~~, by basically taking Alex's code and overriding display_element and removing the $depth check (could be added back with a different parameter).~~ Also added some css classes here and there. It's all in the GIST link below (in the code, a link to the CSS too). Just finished, could be rough, so test it out, but here it works fine! UPDATE: it was mostly CSS. Call with $depth 3 or more! https://gist.github.com/cdsaenz/d6d65294d79a0b71b95c55a4bbd47f7d image

cdsaenz avatar May 08 '22 17:05 cdsaenz

@cdsaenz this seems to work on desktop, but on mobile the menu immediately closes before it can open the third level.

justinb40 avatar May 12 '22 18:05 justinb40

@cdsaenz this seems to work on desktop, but on mobile the menu immediately closes before it can open the third level.

Thanks a lot Justin! Didn't have time to check the mobile menu. More CSS required, will see to that!

cdsaenz avatar May 12 '22 19:05 cdsaenz

@cdsaenz this seems to work on desktop, but on mobile the menu immediately closes before it can open the third level. The solution as nicely stated in https://stackoverflow.com/a/18024991/827376 where I took some of the code, works either with some javascript or via hover "expanding" (display none to block) . As Alex I don't like the hover solution that much :) But that's how I left it in the CSS gist for now.

UPDATE: I think I found the culprit :) These lines in theme.js are hiding the canvas when clicking on the next level. Without these lines you don't need the hover open, but obviously they're used for something else. Need to see why I'm getting caught by this query and avoid it.

$('.offcanvas a:not(.dropdown-toggle):not(a.remove_from_cart_button), a.dropdown-item').on('click', function() {
         $('.offcanvas').offcanvas('hide');
});

cdsaenz avatar May 12 '22 23:05 cdsaenz

Hi guys, how is this fix going? I'm not liying if I say I've been weeks looking for a fix and this is where the fix is almost found. The solutions of @DrogoNevets almost does it (except the hover issue mentioned by @AlexWebLab ). Is there any plan of publishing it?

Thnks so much

jakenCD avatar Aug 04 '22 16:08 jakenCD

find the fix here https://github.com/imanishpushkar/bs5-navwalker

imanishpushkar avatar Sep 01 '22 12:09 imanishpushkar

Thanks!

On dj., de set. 1, 2022 at 14:15, Manish @.***> wrote:

find the fix here https://github.com/imanishpushkar/bs5-navwalker

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

jakenCD avatar Sep 03 '22 18:09 jakenCD

Just tried it. It works, at first sight, beautifully. THANKS En sábado, 3 de septiembre de 2022, 20:31:21 CEST, jordi cd @.***> escribió:

Thanks!

On dj., de set. 1, 2022 at 14:15, Manish @.***> wrote:

find the fix here https://github.com/imanishpushkar/bs5-navwalker

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

jakenCD avatar Sep 06 '22 08:09 jakenCD

Sorry to bother you again. I've inspected the element and in device it doesn't load the 3rd level of the menu.  I copied your exact code and the problem persisted. I do not get what's wrong traveladic.com  En martes, 6 de septiembre de 2022, 11:02:42 CEST, jordi cd @.***> escribió:

Actually, I just tried it with the phone and the 3rd level is not opening.  En martes, 6 de septiembre de 2022, 10:30:48 CEST, jordi cd @.***> escribió:

Just tried it. It works, at first sight, beautifully. THANKS En sábado, 3 de septiembre de 2022, 20:31:21 CEST, jordi cd @.***> escribió:

Thanks!

On dj., de set. 1, 2022 at 14:15, Manish @.***> wrote:

find the fix here https://github.com/imanishpushkar/bs5-navwalker

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

jakenCD avatar Sep 06 '22 09:09 jakenCD

@jakenCD I have written steps too, follow them, clear your cache, it will work.

imanishpushkar avatar Sep 11 '22 04:09 imanishpushkar

@imanishpushkar working for me, thanks

rickywebmaster avatar Sep 19 '22 11:09 rickywebmaster

It worked like a charm. Thanks!

On dl., de set. 19, 2022 at 13:04, @.***> wrote:

@imanishpushkar working for me, thanks

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

jakenCD avatar Sep 19 '22 11:09 jakenCD

Sorry, it was my fault.  I have the device menu inserted in a modal. That is the problem. Trying to solve it. En martes, 6 de septiembre de 2022, 11:16:34 CEST, jordi cd @.***> escribió:

Sorry to bother you again. I've inspected the element and in device it doesn't load the 3rd level of the menu.  I copied your exact code and the problem persisted. I do not get what's wrong traveladic.com  En martes, 6 de septiembre de 2022, 11:02:42 CEST, jordi cd @.***> escribió:

Actually, I just tried it with the phone and the 3rd level is not opening.  En martes, 6 de septiembre de 2022, 10:30:48 CEST, jordi cd @.***> escribió:

Just tried it. It works, at first sight, beautifully. THANKS En sábado, 3 de septiembre de 2022, 20:31:21 CEST, jordi cd @.***> escribió:

Thanks!

On dj., de set. 1, 2022 at 14:15, Manish @.***> wrote:

find the fix here https://github.com/imanishpushkar/bs5-navwalker

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

jakenCD avatar Oct 11 '22 06:10 jakenCD

Actually, I just tried it with the phone and the 3rd level is not opening.  En martes, 6 de septiembre de 2022, 10:30:48 CEST, jordi cd @.***> escribió:

Just tried it. It works, at first sight, beautifully. THANKS En sábado, 3 de septiembre de 2022, 20:31:21 CEST, jordi cd @.***> escribió:

Thanks!

On dj., de set. 1, 2022 at 14:15, Manish @.***> wrote:

find the fix here https://github.com/imanishpushkar/bs5-navwalker

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

jakenCD avatar Oct 11 '22 07:10 jakenCD

Thanks @imanishpushkar

thewebsitetoday avatar Oct 13 '22 11:10 thewebsitetoday

Thanks @imanishpushkar

robialfaro avatar Feb 21 '23 22:02 robialfaro