Hello,
I’m trying to add deletion to one of my apps. I know the traditional way to handle this is to have a delete button, then a menu that says, “Do you really want to do that? It’s so final!”, and the a check for confirm. This annoys me.
Instead I want to have a button that on single tap pops up a toast saying, “You have to double tap to delete”. When a double tap occurs, the delete happens. I’ve got the two taps working fine. Unfortunately for me both events get triggered. Is there a way to finesse the tap to wait a bit more before firing?
Thanks.
JPD
1 Like
I’m also having the same issue. Sounds like the single tap is not waiting to see if second tap is trigger. When testing this on the local browser (–lab) the single click and double click seem to trigger the tap functionality correctly, but when its pushed out to the phone (ionic run android) the double tap just triggers the single tap twice. Also, the’Hold’ gesture freezes the rest of the gestures once triggered.
Simple functionality in directive:
$ionicGesture.on('doubletap', function(event) {
scope.doubleTap(itemId);
}, elem);
$ionicGesture.on('tap', function(event) {
scope.oneTap(itemId);
}, elem);
$ionicGesture.on('hold', function(event) {
scope.holding(itemId);
}, elem);
on controller:
$scope.oneTap = function(itemId){
alert('ONE TAP!');
}
$scope.doubleTap = function(itemId){
alert('ON DOUBLE TAPED!');
}
$scope.holding = function(itemId){
alert('ON HOLD');
}
Any fix/ Solution will be great.
Thanks
Erick