Categories
CSS

How to prevent pull-down-to-refresh in Mobile Chrome?

Spread the love

Sometimes, we want to prevent pull-down-to-refresh in Mobile Chrome.

In this article, we’ll look at how to prevent pull-down-to-refresh in Mobile Chrome.

How to prevent pull-down-to-refresh in Mobile Chrome?

To prevent pull-down-to-refresh in Mobile Chrome, we can set the overscroll-behavior-y CSS property to contain.

For instance, we write:

html,
body {
    overscroll-behavior-y: contain;
}

to disable pull to refresh in mobile Chrome for the whole page.

Conclusion

To prevent pull-down-to-refresh in Mobile Chrome, we can set the overscroll-behavior-y CSS property to contain.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

2 replies on “How to prevent pull-down-to-refresh in Mobile Chrome?”

I know it’s a fairly minor issue but do you have any ideas on how to prevent this behavior with FireFox on mobile?

I think this should be standard across most browsers, but I haven’t tested on Firefox.

Leave a Reply

Your email address will not be published. Required fields are marked *