1

While filling out an HTML form, I accidentally swiped down and lost all my filled information because the browser reloaded the page. Is it possible to deactivate this swipe down functionality?

My Android version is 4.1.2 and I'm having the Chrome latest version.

  • 1
    As an interim suggestion, if you are trying to scroll the page be swiping just make sure not to begin the swipe from the top of the screen downwards (given that you can't scroll past the top anyways). I don't see an option for this in Chrome's settings. – Matthew Read Jul 31 '15 at 16:56
1

It is possible to disable the feature in Chrome browser version 41 and above. The easiest way to disable this is to visit the chrome://flags in your Chrome address bar and to disable the pull to refresh effect,

chrome://flags (disable-pull-to-refresh-effect)

Preventing the pull-to-refresh effect:(Based on this Chromium docs)

The default action of the pull-to-refresh effect can be effectively prevented by doing any of the following :

  • Applying “touch-action: none” to touch-targeted elements, where appropriate, disabling default actions (including pull-to-refresh) of the touch sequence.

  • Applying “overflow-y: hidden” to the body element, using a div for scrollable content if necessary.

  • preventDefault’ing some portion of the touch sequence, including any of the following (in order of most disruptive to least disruptive):

    1. The entire touch stream (not ideal).
    2. All top overscrolling touchmoves.
    3. The first top overscrolling touchmove.
    4. The first top overscrolling touchmove only when
      • 1) the initial touchstart occurred when the page y scroll offset was zero and
      • 2) the touchmove would induce top overscroll.
  • Disabling the effect locally via chrome://flags (disable-pull-to-refresh-effect).

Note that the pull-to-refresh effect will never activate if any scrolling occurs before the overscrolling motion, e.g., if the user first scrolls down, then back up, or if the page scroll offset is 0 but has a scrolling div that the user scrolls up before overscrolling.

Note:

The pull-to-refresh swipe down feature is added to Chrome version 41.0.2272.92. So any version below that won't be have the pull-to-refresh feature.

  • 1
    Very cool, and a nice detailed answer. – Matthew Read Jul 31 '15 at 19:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.