Materialize: Navbar Dropdown does not work for both desktop and phone

Created on 3 Jul 2020  路  4Comments  路  Source: Dogfalo/materialize

I have a navbar with a dropdown that works in desktop but when I also add the dropdown to the mobile version it works in the mobile but does not work in the desktop version. The desktop version still has the icon but nothing drops down when clicking on it. When I remove the dropdown from the mobile part, the desktop dropdown works again.

All 4 comments

Hi, you need to set a different Id for the mobile dropdown and so change the data-target accordingly

can you please give me a small example because im not sure exactly what you mean. thank you i really appreciate your help

Hi @nh916 here is a codepen where you can see the difference.
Look at the dropdown's id, you will see when it's working, when it's not.

oh i see. I got what you mean!
Thank you for taking the time and helping me see how to make it work!
looking at it now its clearer. I dont think I would have figured this out if i struggled a few more hours without your help. Thanks again!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MickaelH974 picture MickaelH974  路  3Comments

PhillippOhlandt picture PhillippOhlandt  路  3Comments

artur99 picture artur99  路  3Comments

heshamelmasry77 picture heshamelmasry77  路  3Comments

Robouste picture Robouste  路  3Comments