Ionic 4: how to hide ScrollBar in ion-content

Roishuk picture Roishuk · Jan 19, 2019 · Viewed 11.4k times · Source

Im trying to hide the scroll-bar in ion-content (Ionic 4) there's no ion-scroll on ionic 4 so I used the ion-content but I can't find any css attribute to hide it (most of them not work)

I do want to scroll but I don't want to see the scrollbar

::-webkit-scrollbar,
*::-webkit-scrollbar {
  display: none;
}

I've tried it but it doesn't work in ion-content.. thanks alot.

Answer

Rostislav picture Rostislav · Feb 17, 2019

In Ionic 4 you must use following, because Ionic use shadow DOM:

global.scss

.no-scroll {
    --overflow: hidden;
}

and in page

<ion-content class="no-scroll">