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

'press' click is registering in next view #1160

Open
MrJadaml opened this issue Jan 25, 2018 · 0 comments
Open

'press' click is registering in next view #1160

MrJadaml opened this issue Jan 25, 2018 · 0 comments

Comments

@MrJadaml
Copy link

I'm using a long press style event to trigger a menu of items. Though the click event from the press is registering in the menu and selecting the item where ever the user was initiating a long press. How do I stop that click event from registering in the next view?

componentDidMount() {
  const hammer = new Hammer.Manager(this.wrapper);
  hammer.add( new Hammer.Press({ event: 'press', time: 500 }) );
 
  hammer.on('press', (e) => {
    e.preventDefault();

    history.replace(menuURL);
  });
}

currently a regular tap/click navigates to one view, and this longpress pops up a menu.

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