Topic: Dropdown menu with vertical scrollbar

sraitsin free asked 7 years ago


I use dropdown button with dropdown-menu. See example below. How can add vertical scrollbar to menu.  
<div class="btn-group mr-0 p-0" dropdown>
  <button dropdownToggle class="btn btn-sm btn-primary dropdown-toggle waves-light" type="button" mdbRippleRadius>
    Configurations
  </button>

  <div class="dropdown-menu dropdown-primary" >
    <a class="dropdown-item" *ngFor="let item of viewConfigs; index as i;" (click)="selected(item)">{{item.name}}</a>
  </div>
</div>

krishna kumari free answered 4 years ago


.dropdown-menu { max-height: 180px; overflow-y: auto; min-width: 100% !important; background-attachment: local, local, scroll, scroll; }

.dropdown-item { white-space: normal; }


Konrad Stępień staff commented 4 years ago

Hi @krishna kumari

Thank you for your answer!


Dawid Adach pro answered 7 years ago


Dear sraitsin, you can achieve that using custom class:
<div class="dropdown-menu dropdown-primary force-scroll">
.force-scroll {

overflow-y: scroll;

height: 200px;

}

andres vasquez gutierrez free commented 3 years ago

it was very helpful, thank you very much


FREE CONSULTATION

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

Status

Closed

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No
Tags