ng-bootstrap - Typeahead dropdown width

前端 未结 7 823
我在风中等你
我在风中等你 2021-01-18 06:34

I started using the ng-bootstrap Typeahead component and I\'m pretty happy with that.

One thing I would like to achieve is to get the dropdown items to have the same

7条回答
  •  孤城傲影
    2021-01-18 07:12

    This code 100% work, but with the class .dropdown-menu any other dropdown will be changed

    ::ng-deep .dropdown-menu { width: 100%; }
    

    So I just used this code with ngb-typeahead- as the ID:

    ::ng-deep [id^="ngb-typeahead-"]{ 
    width: 100%!important; 
    white-space: nowrap!important;
    overflow: hidden!important;
    text-overflow: ellipsis!important;} 
    

提交回复
热议问题