Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use multiple finger pan,sometimes when all fingers leave screen,I found “hammerManager.input.store” length is not 0 #1301

Open
zZ-feigo opened this issue Dec 16, 2024 · 0 comments

Comments

@zZ-feigo
Copy link

zZ-feigo commented Dec 16, 2024

the demo

const hammerManager = new Hammer.Manager(dom);
let lastPanEndEvent = null;

  // five pan,one finger|two finger | three finger...
  const panArray = [1, 2, 3, 4, 5].map(
    pointers =>
      new Hammer.Pan({
        event: `pan${pointers}`,
        threshold: 4,
        pointers,
        direction: Hammer.DIRECTION_ALL,
      })
  );
  hammerManager.add(panArray);

  hammerManager.on('pan1start pan2start pan3start pan4start pan5start', evt => {});
  hammerManager.on('pan1move pan2move pan3move pan4move pan5move', evt => {});
  hammerManager.on('pan1end pan2end pan3end pan4end pan5end', evt => {
    if (evt.type === 'pan1end' || evt.type === lastPanEndEvent) {
      if (hammerManager.input.store) {
        hammerManager.input.store = [];
      }
      end();
    }
    lastPanEndEvent = evt.type;
  });  
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant