Comments (7)
I think he has the same issue as I do. You have a list with clickable items. On the list is a longpress event. Now pressing on any item on the list will trigger not only the long press event, it will also trigger the click event on the item. Something like $event.preventDefault().
from ngx-long-press2.
I understand
You want to execute the click function after pressing a long click right?
Sorry, maybe I didn't explain properly.
On a div with (onLongPress) and (click) outputs, whenever I trigger "onLongPress", "click" is still being executed after "onLongPress".
I wanted "click" to have behavior A, and "onLongPress" behavior B, but when I trigger "onLongPress" B is executed and A after that.
from ngx-long-press2.
I face the same issue. When there is a (click) event and (onLongPress) event on the same element, click event fires after the onLongPress event. Is there any way to prevent this?
from ngx-long-press2.
I understand
You want to execute the click function after pressing a long click right?
from ngx-long-press2.
What I did to fix this issue
(mouseup)="$event.stopPropagation()" (touchend)="$event.stopPropagation()" (click)="$event.stopPropagation(); $event.preventDefault();"
from ngx-long-press2.
@logan-jobzmall Thanks.
PS: I came across the (contextmenu)
event which can be used for long-press on mobile and right-click on desktops.
from ngx-long-press2.
any PR for this ticket or should I close it for the moment?
from ngx-long-press2.
Related Issues (6)
- Chrome Warning about touchstart event HOT 2
- Could not resolve dependency HOT 4
- Support for Angular 15? HOT 3
- Support for Angular 16? HOT 4
- Angular 17 Compatibility HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngx-long-press2.