Chrome "Touch Events API" interrupts scrolling

I noticed that the page in my web application does not scroll when Chrome is used on a touch screen PC. To test the problem, I went to chrome://flags and disabled the "Touch Events API". And vice versa, for the problem to occur on my development machine, I turn it on (by default automatically).

When the Touch Events API is enabled, Chrome consoles post:

[Violation] Added touchstart event touchstart to touchstart event with scroll lock. Consider the labeling event handler as “passive” to make the page more responsive.

[Violation] Added touchmove event touchmove to touchmove event with scroll lock. Consider the labeling event handler as “passive” to make the page more responsive.

This violation comes from my jquery.min.js file. Version 2.1.3.

Questions:

  • I don't need any touch features - can I disable the Touch Events API. And / or is it best practice?
  • Will the latest jQuery version fix this problem? I'm worried about such a big version of the jump ...
  • Reading the violation recommendation, should I think of the event handler as “passive” to make the page more responsive. "- What does this mean? There are some JS functions that affect window size and scrolling, how can I make them passive?
+8
jquery google-chrome events
source share
1 answer

Do you have an example JSFiddle or code that we can verify? I am wondering if there are any problems in your code.

You can also see the solution in this matter if you have more problems. Perhaps this is a simple fix or a longer need to write your own PassiveEvent handler.

Warning: added non-passive event listener to touchstart event with scroll lock

0
source share

All Articles