question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: Ionic Gesture interferes with ionic swipe

See original GitHub issue

Bug Report

Ionic version: [x] 5.6.3

Current behavior: As soon as I register a gesture on an element, the menu swipe doesn’t work anymore when I am swiping over the element, even with a blank gesture

Expected behavior: The menu swipe gesture and my custom gesture should work together

Steps to reproduce:

To recreate:

  • ionic start sidemenu
  • remove the split pane around the menu in src/app/app.component.html
  • Create the gesture in src/app/folder/gesture.directive.ts
  • register the gesture in src/app/folder/folder.module.ts
  • add the gesture to the div with the id container in src/app/folder/folder.page.html
  • enlarge the div in src/app/folder/folder.page.scss, stick to upper screen and make grey

To reproduce:

  • npm start
  • Go to http://localhost:4200
  • The gesture is registered on the upper half of the screen (grey background)
  • If you try to swipe open the menu on the upper half of the screen, it won’t open. The lower half works

Related code:

https://github.com/philippendrulat/MenuBug

Ionic info:

Ionic:

   Ionic CLI                     : 6.12.3 (C:\Users\Philipp\AppData\Roaming\npm\node_modules\@ionic\cli)
   Ionic Framework               : @ionic/angular 5.6.3
   @angular-devkit/build-angular : 0.1102.8
   @angular-devkit/schematics    : 11.2.8
   @angular/cli                  : 11.2.8
   @ionic/angular-toolkit        : 3.1.1

Utility:

   cordova-res                          : 0.15.3
   native-run (update available: 1.3.0) : 0.2.8

System:

   NodeJS : v14.16.0 (C:\Program Files\nodejs\node.exe)
   npm    : 6.14.11
   OS     : Windows 10

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
philippendrulatcommented, Apr 8, 2021

Yeah but this means that the user won’t be able to click on a document (or in this case - folder) if he clicks on the icon Screenshot-app

We don’t necessarily need the tap gesture, but we have a longpress gesture, which means we have to differenciate between tap and long press

1reaction
philippendrulatcommented, Apr 8, 2021

Thank you for the fast response. Maybe I have to explain our use case. We are using a custom longpress and tap directive. There is no moving when I am tapping. So if we set the threshold to 1, the “tap” event won’t fire anymore (even if the menu works again). Why do the gestures interfere with each other anyway?

We were using hammerjs gestures before, but they were not working properly, which is why we had to create our own.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Swipe Back Nav Flicker (iOS PWA) - Ionic Framework
While this is not a bug in Ionic, there is no good workaround at the moment other than disabling Ionic's swipe to go...
Read more >
How to debug Ionic iOS swipe gesture issues - Stack Overflow
I am dealing with a weird bug on Ionic's iOS native build where I sometimes cannot swipe back or switch tabs once I...
Read more >
Ionic 6 Angular Gestures (Tap, DoubleTap, Long ... - YouTube
Ionic 6 Angular Gestures (Tap, DoubleTap, Long Press & Swipe Gestures ) using directives ; # ionic ; #angular for ; #pwa, ;...
Read more >
Building Interactive Ionic Apps with Gestures and Animations
Since Ionic 5 we got access to a great Animations and Gestures utility API, which can help to add both simple interactive elements...
Read more >
Make List Items Swipeable In Ionic Framework
Use the can-swipe attribute with ion-option-button to make Ionic Framework list items have swipe-able UI features.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found