# jquery.js:5092 \[Violation] Added non-passive event listener to a scroll-blocking 'touchstart' (ok)

![](https://2494213435-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LYjAG13rAPdbArSfRyB%2F-LtVbcwhWKnDDGnf4Prg%2F-LtVcLRkX_odjxpeYOWj%2FTouch%201.png?alt=media\&token=bb2f96a1-cb9c-4e47-8fec-e13902ce72cd)

![](https://2494213435-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LYjAG13rAPdbArSfRyB%2F-LtVbcwhWKnDDGnf4Prg%2F-LtVcPkNxVlfLxdM3TUY%2FTouch%202.png?alt=media\&token=31a722ca-1a90-4ff3-bf46-f2d49370051d)

This solve the problem to me:

```
jQuery.event.special.touchstart = {
  setup: function( _, ns, handle ){
    if ( ns.includes("noPreventDefault") ) {
      this.addEventListener("touchstart", handle, { passive: false });
    } else {
      this.addEventListener("touchstart", handle, { passive: true });
    }
  }
};
```

I am using various events and this seems to solve my use case

```
(function () {
    if (typeof EventTarget !== "undefined") {
        let func = EventTarget.prototype.addEventListener;
        EventTarget.prototype.addEventListener = function (type, fn, capture) {
            this.func = func;
            if(typeof capture !== "boolean"){
                capture = capture || {};
                capture.passive = false;
            }
            this.func(type, fn, capture);
        };
    };
}());
```
