Hacker News new | ask | show | jobs
by rfolstad 3485 days ago
i was hoping this was a library that would help me to disable pull to refresh. Anyone know of a good library that can help to disable this in browsers?

Pull to refresh on mobile chrome or safari is really terrible ux for web apps. It's ok for content sites but if you have an app that you want to behave like a native app it's really terrible. A good example is maps.google.com. Even if you install it as a home screen app it still has the stupid pull to refresh gesture in chrome.

I wish there was some way to disable it in browsers. I have tried many things like position: fixed or overflow-y:hidden but these have other side effects like preventing the keyboard from repositioning the window in chrome or safari.

In general if a web browser overrides any touch gestures they should be able to be disabled by the page without having to handle every touchmove yourself.

1 comments

I don't think you need a library for that, it's just a few lines. I'm currently a little busy, but there's one touch event that disables those «features» (can't remember which).

I'd suggest you to download the library and delete some of the lines for the callbacks on the touch events, maybe you can isolate it and figure out what is achieving that result.

Or, you could try something like this:

    PullToRefresh.init({
      mainElement: '#main',
      distMax: 0,
      onRefresh: function(){}
    });