Tap Hold Event (Long Tap)

Framework7 has so called “tap hold” event. It triggers (if enabled) after a sustained, complete touch event. By default it is disabled and could be enabled and configured using touch.tapHold... App parameters on app initialization.

Note, that Tap Hold is a part of built-in Fast Clicks library, so Fast Clicks should be also enabled.

Also note, that you probably will need to disable mobile browser default “long-tap” actions by adding these CSS rules to elements:

  1. -moz-user-select: none;
  2. -webkit-user-select: none;
  3. user-select: none;

For example:

  1. var app = new Framework7({
  2. touch: {
  3. tapHold: true //enable tap hold events
  4. },
  5. });
  6. var $$ = Dom7;
  7. $$('.some-link').on('taphold', function () {
  8. app.dialog.alert('Tap hold fired!');
  9. });