a list of items with (press) to open actionsheet, but it does not scroll on touch (works with mousewheel)
Steps to reproduce:
style="touch-action: none; -webkit-user-select: none; -webkit-user-drag: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
Which Ionic Version? 2.x
http://plnkr.co/edit/RlQN1xdvIrmdUNp2XLSn?p=preview
you need the touch events to see the problem.
to have only the code:
http://run.plnkr.co/BpjNf4BrhbQdWNab/
in the plunker i also added my workaround (toggle at the beginning of the list forces touch-events back to it's default value)
Hello! Thanks for opening an issue with us! Good catch, we are also able to reprodoce this issue and will be looking into it.
In this case, just using (click) is recommended. Hammer's press adds a few more handlers that makes things more difficult, where click should be working fine for this scenario.
on (click) I open the page for the entry, and on (press) I'd like to show the the action sheet.
-> therefore switching to (click) won't solve the issue itself.
the main problem I can see so far is that the css prevents the touch action (by removing it scroll works again)
having exactly the same problem
just face the same issue when adding a swipe or click event on the ion-item!
Hi, I also got the same problem on putting press in the ion-item. Is there any solution for this?
the solution is to use virtualscroll (you can check an example in the commit above)
After I upgraded from 2.3.0 to 3.0.0, this is happening. Any suggestion how i can use (click) and (press) at the same time?
After I upgraded from 2.3.0 to 3.0.0, this is happening. Any suggestion how i can use (click) and (press) at the same time?
I have the same problem ..
Hello,
I am having the same problem. This happens with any combo of 2 or more events (click and swipe, for example).
List scrolling was working just fine in Ionic 2 and it's now broken after upgrading to Ionic 3.0.1.
Some code here to illustrate the problem.
I faced this issue after upgrading from Ionic 2.3.0 to 3.0.1. But in my case I just had the tap event. Fixed it changing to the click event (but I don't have other events besides click). It seems the touch events aren't working well in a list of items after the upgrade. I think something in the touch events are preventing the scroll.
I my case I need each item has (click) and (press) events. Adding last one locks scrolling when you try to scroll from the item.
I'm using IONIC 3.0.1.
I was able to solve this problem by creating a custom directive for the press event, based on: http://stackoverflow.com/questions/43492833/ionic-2-setting-callback-for-long-press-event-directive.
import { Directive, ElementRef, OnInit, OnDestroy, Output, EventEmitter } from '@angular/core';
import { Gesture } from "ionic-angular/gestures/gesture";
@Directive({
selector: '[long-press]'
})
export class PressDirective implements OnInit, OnDestroy {
el: HTMLElement;
pressGesture: Gesture;
@Output('long-press') onPressRelease: EventEmitter<any> = new EventEmitter();
constructor(el: ElementRef) {
this.el = el.nativeElement;
}
ngOnInit() {
this.pressGesture = new Gesture(this.el);
this.pressGesture.listen();
this.pressGesture.on('press', (event) => {
this.onPressRelease.emit('released');
});
}
ngOnDestroy() {
this.pressGesture.destroy();
}
}
And then use (long-press)="myfunction()"...
Great! That worked form me!
For those still looking to enable scrolling, and not having to use JavaScript code for gestures, here is the solutions that worked for me to use HammerJS in Ionic project and still have scroll.
https://github.com/hammerjs/hammer.js/issues/1014#issuecomment-372513548
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Most helpful comment
I was able to solve this problem by creating a custom directive for the press event, based on: http://stackoverflow.com/questions/43492833/ionic-2-setting-callback-for-long-press-event-directive.
And then use
(long-press)="myfunction()"...