Search code examples
angularangular-materialperfect-scrollbar

Make ngx-perfect-scrollbar visible by default


I am using ngx-perfect-scrollbar on div element like this:

<div [perfectScrollbar]="config" [ngStyle]="{ 'max-height': '60vh', position: 'relative' }">
.
.
.
.
</div>

But the scrollbar is visible only when I hover mouse over the div element of scrollbar. How do I make this visible all the time?


Solution

  • Perfect scrollbar is hidden by opacity.

    You can give perfect scrollbar already declared class:

    ps-show-always
    

    Which adds this:

    perfect-scrollbar.ps-show-always > .ps.ps--active-y > .ps__rail-y,
    perfect-scrollbar.ps-show-always > .ps.ps--active-x > .ps__rail-x {
      opacity: 0.6;
    }