close

[Solved] Unable to preventDefault inside passive event listener

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error Unable to preventDefault inside passive event listener in javascript. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Unable to preventDefault inside passive event listener Error Occurs?

Today I get the following error Unable to preventDefault inside passive event listener in javascript.

How To Solve Unable to preventDefault inside passive event listener Error ?

  1. How To Solve Unable to preventDefault inside passive event listener Error ?

    To Solve Unable to preventDefault inside passive event listener Error

  2. Unable to preventDefault inside passive event listener

Solution 1

To handle sortable list in Framework7 when user release currently sorting element in new position, you can use this code:

  $$('li').on('sortable:sort',function(event){
    alert("From " + event.detail.startIndex + " to " + event.detail.newIndex);
  });

Solution 2

For me

document.addEventListener("mousewheel", this.mousewheel.bind(this), { passive: false });

did the trick (the { passive: false } part).

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also Read

Leave a Comment