Open RobinDev opened 5 years ago
Same issue here, and a more limited demo: https://codepen.io/anon/pen/JVgqKr
(check console)
Since Release 2.9.0 dragging an element (in my case in a form tag > ul class="tns-slider" > li > div > input + img) produces error in Chrome Dev Tools:
tiny-slider.js:2995 Unable to preventDefault inside passive event listener invocation. onPanMove | @ | tiny-slider.js:2995
If one of the tns-controls is clicked, the form is not submittet, but a request is fired to current Url with the currect active hidden input type="radio" name + value in the slide.
With Release 2.8.8 this behavior can't be reproduced
Hi !
Unfortenately, I can reproduce this too... I couldn't spend more time to investigate, but I think the problem is in the function onPanEnd
, that somehow doesn't prevent the event the initial click
event...
But still not sure, I disabled dragging to avoid the problem.
Hello, i had the same issue using ngx-tiny-slider.
Solved by doing this:
//.ts
mousePosition = { x: 0, y: 0 };
mouseDown($event) { this.mousePosition.x = $event.screenX; this.mousePosition.y = $event.screenY; }
onClick($event) { if (this.mousePosition.x === $event.screenX && this.mousePosition.y === $event.screenY) { //your function here... } }
//.html ngx-tiny-slider div (mousedown)="mouseDown($event)" (click)="onClick($event)" //your tags here.. div ngx-tiny-slider
Nice but would really like a fix for the non-ngx version
The combination of these two answers
fixed the problem for me.
The combination of these two answers
fixed the problem for me.
⚠️ Be careful of use dragEnd, because this event is not fired when curson returns to exactly same place after dragMove
I used event listener trick but sometimes it didn't triggered. Finally I switched to the Splide. It doesn't have this problem.
I re-open an old issue #189
If you drag an element with a link, link is open : https://codepen.io/anon/pen/OaMLew