Classic tabs navbar with dropdown not working propery


Topic: Classic tabs navbar with dropdown not working propery

alex9249 pro asked 7 years ago

I am trying to have a classic tabs navbar with several nav items in it, one of those being a drop down list. However, there is something weird going on with the css for .classic-tabs. When you show the dropdown menu it will appear to open inside the navbar itself and adds a scroll bar instead of popping out above the navbar. I can't figure out which css property is causing this to happen, but if i remove the classic-tabs class, the dropdown list works as intended.

 

 


Jakub Strebeyko staff answered 7 years ago

Hi there Alex,

Thanks for reaching out! How are you adding the dropdown? Taking the one from the docs and omitting the wrapping .btn-group class returns a dropdown working correctly in classic tabs on my end. What about yours?

With Best Regards,
Kuba


alex9249 pro answered 7 years ago

Here is just some example code: <ul class="nav classic-tabs tabs-cyan" role="tablist"> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">Dropdown</a> <div class="dropdown-menu"> <a class="dropdown-item" href="#">Action</a> <a class="dropdown-item" href="#">Another action</a> <a class="dropdown-item" href="#">Something else here</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="#">Separated link</a> </div> </li> </ul> I tried changing it over to a button like the example you gave but it produced the same result. If i remove the .classic-tabs class everything works fine. If there is something i am doing wrong please let me know.

Jakub Strebeyko staff answered 7 years ago

Hi there, It's the position: relative of .dropdown causing the issue. Please use <li class="nav-item dropdown" style="position: static;"> instead. To compensate for traditionally bright font on .classic-tabs, consider
  .classic-tabs li a.dropdown-item {
    color: black
  }
Best, Kuba
Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No