Scroll assist prevents propagation of events on iOS which does not work well with a custom Gesture that implements long press event (onEnd never gets called so my timer runs out and triggers long press event action).
Even the simplest @HostBinding is not working since scroll assist calls stopPropagation on the event.
Is there some way to get click/touchEnd event on gesture’s directive?
Version: ionic 5.1.1
P.S. If I comment-out the selected lines everything works as expected
Do you have a sample of what code you are trying?
Here is an example directive, attach it to ion-input or its wrapper
import { Gesture } from "@ionic/core";
import {Directive, OnInit, ElementRef} from "@angular/core";
import {GestureController} from "@ionic/angular";
@Directive({
selector: "[appExample]"
})
export class ExampleDirective implements OnInit {
gesture: Gesture;
constructor(private elementRef: ElementRef, private gestureCtrl: GestureController) {
}
ngOnInit() {
this.createGesture();
}
private createGesture() {
this.gesture = this.gestureCtrl.create({
el: this.elementRef.nativeElement,
gestureName: "example",
threshold: 0,
onStart: () => {
console.log("this is called");
},
onEnd: () => {
console.log("this is not called since scroll assist prevents event propagation");
}
}, true);
this.gesture.enable(true);
}
}
I ended up overriding stopPropagation function since that seems like the only possible way to avoid this bug.