react-pull-to-refresh
react-pull-to-refresh copied to clipboard
Can't scroll on mobile
On a mobile device or in chrome dev tools emulating a device I cannot scroll. Scrolling up does nothing and scrolling down activates the pull to refresh.
I stumbled across this library yesterday and tried to use it on our web app. This seems to be a hammerjs ( the touch control library used by this ) problem. If you use inspector to cancel the css props on .refresh-view this component generated ( user-select, user-drag, touch-action ), you will be able to scroll again, but it might become a little buggy in desktop browsers.
So to use this lib you might need to fork your own hammerjs or request hammerjs to provide an option to disable those css props.
How to reslove
@goshcc, as @simonxeko points out, this is a due to the default touch-action in hammerjs is 'none'. A fix could be to set the default to 'pan-y'. Like this:
let hammer = require('hammerjs'); hammer.defaults.touchAction = 'pan-y';
This might not be the best solution, but will fix your immediate problem.
EDIT: Ignore proposed solution. Will break how the component works.
@bryaneaton13 hello :) any idea if and when this issue will be fixed ? Thanks
hi, has anyone addressed this issue?
I also encountered the same problem, I ask you to solve it?
This solution breaks the pull to fresh behaviour on mine.
nanshou
Has anyone come up with a solution to this?
bump
I forked this repo and made a hack to solve this, if this hack solution may help u . https://www.npmjs.com/package/react-pull2refresh
I tried your repo @princewck, but I still have an issue, when I pull down the handler does get called, however the issue is with the scroll, so if scroll down on a screen when you try to scroll back up or pulling the screen down just to move the page the handler gets called and I cant move the screen "up".
To scroll correctly I need to "pull up" a little bit and then "pull down/scroll" (all in one touch movement).
@hectorhottomali yes, I finally tried other alternatives and pulltorefreshjs this package solved my problem.
We experience the same problem on iOS and Android web view.
https://www.npmjs.com/package/pulltorefreshjs also does not work with Cordova web-view. Folks may like to look at how Ionic V1 solved this problem.
Isnt pull to refresh typically thought of as a mobile thing, and it doesnt work on mobile... sofaking confused.
use this https://thmsgbrt.github.io/react-simple-pull-to-refresh/ this works on mobile too.