Open brandonballinger opened 9 years ago
I have the same problem! Thank you for pointing it out!
This seems to break things on iOS Safari, were you testing a desktop browser? Seems to work there.
This was with an iOS WKWebView (which, in theory, should have the same behavior as iOS Safari) and Chrome desktop.
IIRC, it did break horizontal scrolling, so I ended up overriding the HammerJS touchAction setting. If it's helpful, here's the initialization code I've been using for the last couple of months:
var WebPullToRefresh = require('wptr');
Hammer.defaults.touchAction = 'auto'; // re-enable browser default scrolling
WebPullToRefresh.init({
loadingFunction: () => {
return new Promise((resolve, reject) => {
this.refreshSong({}, (err) => !!err ? reject() : resolve())
});
}
});
(My memory may be a little hazy—I've been using wptr for the last couple of months and it's been doing it's job pretty well in our little app!)
this fixed the problem for me - thanks
Unfortunately, both of this solutions (commenting the line and/or adding the new init code) get native vertical touch scrolling to work (good!) but break the pull to refresh, in iOS Safari and Chrome. So far, I'm still unable to get the pull to refresh to work with native touch scrolling.
Same of @jlft here
In Android and iOS , same demo as in Github with more content on the page (more than layout viewport height) stops vertical scrolling of the page
I am having the same issue, any progress @apeatling ?
Same issue, scroll not working after wptr init on some devices....
For me, this simple one liner fixed everything that was breaking the scrolling on iPhone 6 (9.3.2). Find the instantiation of the Hammer object and append another parameter to reset the touchAction (line 65 in wptr.1.1.js).
var h = new Hammer( options.contentEl, { touchAction: 'auto' });
@Aetiranos Thank's, this solves the problem of the scroll is not working on some devices.
The scroll works on Windows Mobile 10, but not the refresh...
@Aetiranos's solution fixes an issue with iOS 8.4 where the ptr container would not scroll on focus, but would scroll if you focused on the overflow of the container (super weird).
If you have a content element that extends past the bottom of the screen and use WPTR, the user can no longer drag to scroll the page. I was able to isolate the problem to this call to HammerJS in init(): h.get( 'pan' ).set( { direction: Hammer.DIRECTION_VERTICAL } );
I tried commenting that line out, and everything else in WPTR seems to work just fine in my app. Happy to send you a PR to delete that line if you think there are no unintended side effects.