John Duck
John Duck

Reputation: 85

Scrollbar isn't hidden on mobile

I'm trying to hide the scrollbar from every element on my Vue + Vite app. I don't want to disable scroll, just hide it, so I'm using the following code.

*::-webkit-scrollbar {
    display: none !important;
}

It works fine and the scrollbar is hidden on desktop dimensions, but it doesn't disappear on mobile, even on Chrome devtools mobile. Here's my meta if that's of any help.

<meta name="viewport" content="width=device-width, initial-scale=1.0" />

I'm using a default Vue Vite app, with some vertically overflowing content.

Upvotes: 1

Views: 953

Answers (1)

Mathias Aivasovsky
Mathias Aivasovsky

Reputation: 76

you could try to make the scrollbar transparent:

::-webkit-scrollbar {
width: 0px;
background: transparent; 
}

You should place this code on a @media tag, so that it only affects mobile.

This solution was taken from this thread.

Upvotes: 1

Related Questions