Skip to content
This repository was archived by the owner on Feb 24, 2025. It is now read-only.
This repository was archived by the owner on Feb 24, 2025. It is now read-only.

Pull to refresh isn't disable on iOS #1

Open

Description

@shivamsupr

Activity

  1. changed the title [-]Pull to refresh isn't disable in iOS[/-] [+]Pull to refresh isn't disable on iOS[/+] on Aug 5, 2018
  2. nghiepdev commented on Aug 6, 2018

    @nghiepdev
    Owner

    Maybe the issue on the chrome recent versions.

  3. Jonathan002 commented on Oct 5, 2018

    @Jonathan002

    This doesn't seem to work with Chrome 69.0.3497.105 on iOS 11.3. I've also tried multiple other solutions and that had seemed to work before from the reactions of others but they do not work for me for this version.

    Other solutions I've tried:

  4. apptaro commented on Nov 5, 2018

    @apptaro

    we need to add { passive: false } for touch move like:

    document.addEventListener('touchmove', touchmoveHandler, { passive: false });
    

    because from some version of Chrome, event listeners are default passive true.

  5. nghiepdev commented on Nov 5, 2018

    @nghiepdev
    Owner

    @apptaro Thank for your support.
    It works!
    I just published the new patch version for the issue.

  6. shivamsupr commented on Nov 5, 2018

    @shivamsupr
    Author

    @nghiepit It's still happening just for the initial load it doesn't happen. check this https://o1l55wryq.codesandbox.io.

    To replicate:
    Scroll up once and then scroll down. You'll see pull-to-refresh.

  7. apptaro commented on Nov 5, 2018

    @apptaro

    I know what's wrong. When a page is short, scrollling down (panning up) doesn't actually scroll the page, so scrolling up (panning down) will activate pull-to-refresh.

    https://github.com/nghiepit/prevent-pull-refresh/blob/master/index.js#L78
    here, "maybePrevent" shouldn't be set to false unless window.pageYOffset !== 0.

  8. nghiepdev commented on Nov 6, 2018

    @nghiepdev
    Owner

    @apptaro
    Did you mean?

    const touchmoveHandler = event => {
        if (maybePrevent) {
          if (window.pageYOffset !== 0) {
            maybePrevent = false;
          }
          if (isScrollingUp(event)) {
            return event.preventDefault();
          }
        }
      };

    With me. It's still happening, same issue @shivamsupr .
    Can you help me test and make a pull request?

    Thank you in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions