Just started exploring Angular and I've been struggling to customize the scrollbar on a PrimeNG dropdown. Does anyone have any tips or tricks to achieve this?
Here is the HTML code:
<p-autoComplete placeholder="- Select -" (onSelect)="onSelect(dh.head,i)" (onClear)="clearData($event,dh.head, i)" (onDropdownClick)="handleDropdown(event)" field="name" [suggestions]="filteredData" [(ngModel)]="dh.head" (completeMethod)="search($event,i)" [dropdown]="true">
<ng-template let-colval pTemplate="item">
<div innerHTML="{{colval.name | highlight:dh.head}}"></div>
</ng-template>
</p-autoComplete>
This is the CSS for the dropdown panel with the scrollbar:
.ui-autocomplete .ui-autocomplete-panel {
position: absolute;
overflow: auto;
width: 290% !important;
}
I attempted adding the following CSS to the component:
::-webkit-scrollbar {
width: 12px;
}
::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
border-radius: 10px;
}
::-webkit-scrollbar-thumb {
border-radius: 10px;
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5);
}
Unfortunately, the above styles didn't affect the dropdown scrollbar. Any suggestions or assistance would be greatly appreciated.