# How to stop pull-to-refresh in p5.js Web Editor

**URL:** <https://discourse.processing.org/t/how-to-stop-pull-to-refresh-in-p5-js-web-editor/14058>\
**Category:** p5.js\
**Created:** [September 18, 2019, 9:15pm UTC](https://discourse.processing.org/t/how-to-stop-pull-to-refresh-in-p5-js-web-editor/14058 "2019-09-18T21:15:24Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![rise](https://avatars.discourse-cdn.com/v4/letter/r/958977/32.png) [@rise](https://discourse.processing.org/u/rise)\
**Post date:** [September 18, 2019, 9:15pm UTC](https://discourse.processing.org/t/how-to-stop-pull-to-refresh-in-p5-js-web-editor/14058/1 "2019-09-18T21:15:24Z")

</div>

Hi,

I’ve created a webpage that involves some dragging and dropping features and I would like to disable the “pull-to-refresh” feature of the browser.

I read that by adding the line “overscroll-behavior-y: contain;” to the css file it will disable the pull to refresh feature while still allowing for normal swiping behavior. ([https://drafts.csswg.org/css-overscroll/#propdef-overscroll-behavior](https://drafts.csswg.org/css-overscroll/#propdef-overscroll-behavior))

When I added this to the style.css file in my Sketch files in the Web Editor, the text turns red and it doesn’t seem to work.

Can anyone provide some insight or point me in the right direction?

---

<div class="post-metadata">

**Author:** ![Tiemen](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tiemen/32/5477_2.png) [@Tiemen](https://discourse.processing.org/u/Tiemen)\
**Post date:** [September 19, 2019, 9:51am UTC](https://discourse.processing.org/t/how-to-stop-pull-to-refresh-in-p5-js-web-editor/14058/2 "2019-09-19T09:51:28Z")

</div>

Welcome to the forum Rise. Any chance you can share the sketch that you made in Web Editor with us? If it’s too big or it contains personal information, I suggest making an [MCVE](https://stackoverflow.com/help/minimal-reproducible-example) and share that instead.

---

<div class="post-metadata">

**Author:** ![rise](https://avatars.discourse-cdn.com/v4/letter/r/958977/32.png) [@rise](https://discourse.processing.org/u/rise)\
**Post date:** [September 19, 2019, 7:41pm UTC](https://discourse.processing.org/t/how-to-stop-pull-to-refresh-in-p5-js-web-editor/14058/3 "2019-09-19T19:41:41Z")

</div>

[https://editor.p5js.org/ChristianPretorius/full/iQwJOtCQw](https://editor.p5js.org/ChristianPretorius/full/iQwJOtCQw)

---

<div class="post-metadata">

**Author:** ![Tiemen](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tiemen/32/5477_2.png) [@Tiemen](https://discourse.processing.org/u/Tiemen)\
**Post date:** [September 19, 2019, 8:28pm UTC](https://discourse.processing.org/t/how-to-stop-pull-to-refresh-in-p5-js-web-editor/14058/4 "2019-09-19T20:28:47Z")

</div>

Have you tested this sketch on your mobile and does it refresh when you swipe down? I’ve tried it with several devices and different browsers, but none of them refresh the web page or canvas when I swipe down- or upwards.

Seeing I can’t experience the problem it’s harder for me to help you, but perhaps some pointers might help you get closer to a solution:

1. I notice your sketch lacks semicolons. Don’t forget to add one of these bad boys after each line of code.
2. Have you checked the [browser-compatibility](https://developer.mozilla.org/en-US/docs/Web/CSS/overscroll-behavior-y) for **overscroll-behaviour-y**? Perhaps you’re testing with a browser that’s not compatible with it.
3. Have you tried adding ‘overscroll-behavior-y: contain;’ to **canvas** instead of **html, body**?

---

<div class="post-metadata">

**Author:** ![rise](https://avatars.discourse-cdn.com/v4/letter/r/958977/32.png) [@rise](https://discourse.processing.org/u/rise)\
**Post date:** [September 19, 2019, 9:13pm UTC](https://discourse.processing.org/t/how-to-stop-pull-to-refresh-in-p5-js-web-editor/14058/5 "2019-09-19T21:13:38Z")

</div>

Thanks for testing and the reply.

1. will do.
2. I didn’t, but I’m running Chrome v76 on Android 9 (I don’t think this is the problem).
3. I did, still refreshing.

I don’t understand how it’s not refreshing on your devices/browsers. I’ve tried it on my mobile in both Brave & Chrome browsers - refreshes both times… I’ve tried to attach 2 screenshots.

strange…

 ![1d70e88c-8ad7-401d-a876-5b8e45de5f05](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/2/2de0ad98e46c22a493c4012264d7d437280c61ce.jpeg)

---

<div class="post-metadata">

**Author:** ![Tiemen](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tiemen/32/5477_2.png) [@Tiemen](https://discourse.processing.org/u/Tiemen)\
**Post date:** [September 19, 2019, 11:36pm UTC](https://discourse.processing.org/t/how-to-stop-pull-to-refresh-in-p5-js-web-editor/14058/6 "2019-09-19T23:36:44Z")

</div>

Let’s wait for some other peeps to test on their mobile devices as well 🙂

---

<div class="post-metadata">

**Author:** ![rise](https://avatars.discourse-cdn.com/v4/letter/r/958977/32.png) [@rise](https://discourse.processing.org/u/rise)\
**Post date:** [September 19, 2019, 11:51pm UTC](https://discourse.processing.org/t/how-to-stop-pull-to-refresh-in-p5-js-web-editor/14058/7 "2019-09-19T23:51:58Z")

</div>

Had a friend try it too with no luck. Still refreshing. I’ll keep testing and update. Thanks for your feedback and helping out. Much appreciated!

---

<div class="post-metadata">

**Author:** ![Tiemen](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tiemen/32/5477_2.png) [@Tiemen](https://discourse.processing.org/u/Tiemen)\
**Post date:** [September 22, 2019, 8:54pm UTC](https://discourse.processing.org/t/how-to-stop-pull-to-refresh-in-p5-js-web-editor/14058/8 "2019-09-22T20:54:33Z")

</div>

Managed to get my hands on a tablet with Chrome, and had the same refresh issue. Do you know if the problem only happens in Chrome with mobile/tablet devices? (I have a laptop with touch screen and it’s not refreshing there)

Secondly, have you considered using `touch-action: none` for your sketch?
