How to set max-height for the scroll bar in autoco

2019-08-15 19:29发布

I am using autocomplete component in my project, along with the autocomplete component i have added an button inside the component for adding a new customer as shown in below image. enter image description here

Here i want to achieve 2 things:

1) I want to make button as fixed even after the scroll(i,e Add New Customer).

2) I want to reduce the height of the scroll bar. How can i do this? Here is the forked stackblitz link

1条回答
Emotional °昔
2楼-- · 2019-08-15 20:18

1) Use position:sticky:

.add-button{
  position: sticky;
    top: 0;
    z-index: 2;
}

2) Use height to .cdk-overlay-pane with ::ng-deep

::ng-deep .cdk-overlay-pane{
    height: 150px!important;}

See here:https://stackblitz.com/edit/angular-9ao75y-fc23aj?file=app/autocomplete-filter-example.css

查看更多
登录 后发表回答