Disabling android's chrome pull-down-to-refresh feature

前端 未结 15 2592
予麋鹿
予麋鹿 2020-12-02 04:20

I\'ve created a small HTML5 web application for my company.

This application displays a list of items and everything works fine.

The application is mainly us

15条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-02 04:39

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

    1. preventDefault’ing some portion of the touch sequence, including any of the following (in order of most disruptive to least disruptive):
      • a. The entire touch stream (not ideal).
      • b. All top overscrolling touchmoves.
      • c. The first top overscrolling touchmove.
      • d. 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.
    2. Applying “touch-action: none” to touch-targeted elements, where appropriate, disabling default actions (including pull-to-refresh) of the touch sequence.
    3. Applying “overflow-y: hidden” to the body element, using a div for scrollable content if necessary.
    4. Disabling the effect locally via chrome://flags/#disable-pull-to-refresh-effect).

    See more

提交回复
热议问题