I"m using Framework7 sortable list and it works well, simply that the doesn"t trigger an occasion when the list is changed.

So I"m make the efforts a few built-in events:

$(".sortable-handler").on("touchstart", duty (e) e.preventDefault(); alert("touchstart"););$(".sortable-handler").on("touchmove", duty (e) e.preventDefault(); console.log("touchmove"););$(".sortable-handler").on("touchcancel", function (e) e.preventDefault(); console.log("touchcancel"););$(".sortable-handler").mouseleave(function (e) e.preventDefault(); console.log("mouseleave"););.. Yet all I get is:

Which occasion should ns look for to obtain the updated perform on every sort?


javascript jquery html-framework-7
re-superstructure
improve this inquiry
follow
asked Feb 7 "17 in ~ 23:08
*

eozzyeozzy
59.7k9797 yellow badges253253 silver- badges403403 bronze badges
include a comment |

6 answers 6


active earliest Votes
93
See this blog post. If you call preventDefault ~ above every touchstart climate you should additionally have a CSS preeminence to disable touch scrolling like

.sortable-handler touch-action: none;
re-superstructure
boost this prize
follow
edited Apr 3 "19 in ~ 13:26

*

frontendzzzguy
3,2021919 silver- badges3131 bronze badges
answered Feb 17 "17 in ~ 2:32
*

rick ByersRick Byers
2,89811 gold badge1414 silver badges1212 bronze title
3
add a comment |
39
For me

document.addEventListener("mousewheel", this.mousewheel.bind(this), passive: false );did the cheat (the passive: false part).

You are watching: Unable to preventdefault inside passive event listener due to target being treated as passive.


re-superstructure
boost this price
follow
reply Apr 14 "19 at 8:56
*

ranbuchranbuch
1,3121414 silver badges1212 bronze badges
2
include a comment |
18
In level JS include passive: false as third argument

document.addEventListener("wheel", function(e) e.preventDefault(); doStuff(e);, passive: false );
share
improve this answer
follow
answer Dec 29 "19 in ~ 16:00

*

HalfachtHalfacht
66411 yellow badge99 silver- badges1919 bronze badges
2
add a comment |
10
To take care of sortable perform in Framework7 as soon as user release at this time sorting element in new position, you deserve to use this code:

$$("li").on("sortable:sort",function(event) alert("From " + event.detail.startIndex + " come " + event.detail.newIndex); );Fiddle : https://jsfiddle.net/0zf5w4y7/


re-superstructure
improve this answer
follow
answer Feb 8 "17 at 10:01
Agus Sapurta SijabatAgus Sapurta Sijabat
49144 silver- badges1212 bronze title
3
include a comment |
4
I am acquiring this issue when making use of owl carousal and also scrolling the images.

So gain solved just including below CSS in her page.

.owl-carousel -ms-touch-action: pan-y;touch-action: pan-y;or

.owl-carousel -ms-touch-action: none;touch-action: none;
share
enhance this prize
follow
reply Nov 28 "19 at 6:12
Saurabh SolankiSaurabh Solanki
1,9761414 silver badges2727 bronze title
2
add a comment |
1
To still have the ability to scroll this worked for me

if (e.changedTouches.length > 1) e.preventDefault();
re-superstructure
boost this prize
monitor
reply Sep 9 "20 at 19:38
LanceLance
52933 silver- badges1717 bronze badges
0
add a comment |

her Answer


many thanks for contributing solution to stack Overflow!

Please be certain to answer the question. Carry out details and share your research!

But avoid

Asking for help, clarification, or responding to various other answers.Making statements based upon opinion; ago them up with referrals or personal experience.

To find out more, watch our advice on writing an excellent answers.

See more: Watch Sisterhood Of The Travelling Pants 2 Online Free, The Sisterhood Of The Traveling Pants 2


Draft saved
Draft discarded

Sign up or log in


sign up utilizing Google
sign up utilizing Facebook
authorize up utilizing Email and also Password
submit

Post as a guest


name
email Required, however never shown


Post as a guest


name
email

Required, however never shown


article Your answer Discard

By clicking “Post her Answer”, you agree to our regards to service, privacy policy and cookie policy


Not the price you're feather for? Browse various other questions tagged javascript jquery html-framework-7 or asking your own question.


The Overflow Blog
Upcoming events
Featured ~ above Meta
Linked
2
Unable to preventDefault within passive event jquery error
1
Unable come preventDefault within passive event
140
Disable double-tap "zoom" choice in browser on touch devices
2
Jquery $(window) pass option with passive: false
1
preventDefault() error in Chrome for mousewheel DOMMouseScroll
0
Unable come preventDefault inside passive occasion listener on mobile view
0
Preventing the default for a passive default
associated
1676
occasion binding top top dynamically created elements?
3046
JavaScript closure within loops – basic practical instance
0
can not to preventDefault inside passive occasion listener as result of target being treated as passive - Chrome
2
.wheel event | can not to preventDefault within passive event listener because of target gift treated together passive
warm Network questions an ext hot concerns

question feed
i ordered it to RSS
inquiry feed To i ordered it to this RSS feed, copy and also paste this URL right into your RSS reader.


lang-js
stack Overflow
commodities
firm
stack Exchange Network
site architecture / logo design © 2021 ridge Exchange Inc; user contributions licensed under cc by-sa. Rev2021.10.14.40466


Stack Overflow works best with JavaScript permitted
*

your privacy

By clicking “Accept all cookies”, friend agree ridge Exchange have the right to store cookie on your an equipment and disclose information in accordance through our Cookie Policy.