Violation - Added non-passive event listener to a scroll-blocking 'touchstart' / 'wheel' event

Violation - Added non-passive event listener to a scroll-blocking 'touchstart' / 'wheel' event

tikhoninatikhonina Posts: 6Questions: 2Answers: 0

Every time the table is printed I see several warnings in Chrome 'Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive'.
Stack trace:
```
add @ jquery-2.2.4.js:4597
(anonymous) @ jquery-2.2.4.js:4503
each @ jquery-2.2.4.js:365
each @ jquery-2.2.4.js:137
on @ jquery-2.2.4.js:4502
on @ jquery-2.2.4.js:5080
_fnConstruct @ dataTables.fixedColumns.min.js:11
m @ dataTables.fixedColumns.min.js:7
(anonymous) @ dataTables.fixedColumns.min.js:35
dispatch @ jquery-2.2.4.js:4737
elemData.handle @ jquery-2.2.4.js:4549
trigger @ jquery-2.2.4.js:7807
(anonymous) @ jquery-2.2.4.js:7875
each @ jquery-2.2.4.js:365
each @ jquery-2.2.4.js:137
trigger @ jquery-2.2.4.js:7874
_fnCallbackFire @ jquery.dataTables.js:6645
_fnInitComplete @ jquery.dataTables.js:4795
_fnInitialise @ jquery.dataTables.js:4771
loadedInit @ jquery.dataTables.js:1320
(anonymous) @ jquery.dataTables.js:1332
each @ jquery-2.2.4.js:365
each @ jquery-2.2.4.js:137
DataTable @ jquery.dataTables.js:869
$.fn.DataTable @ jquery.dataTables.js:15172
initDataTable @ read_results.js:297
redrawDataTable @ read_results.js:360
searchWithOptions @ read_results.js:370
dispatch @ jquery-2.2.4.js:4737
elemData.handle @ jquery-2.2.4.js:4549

Some of them also refer 'wheel' event.
After all these wornings in the end of the chrome log I see:

[Violation] 'click' handler took 15039ms
[Violation] Forced reflow while executing JavaScript took 4473ms
```
The problem appears to be in the initialization of a table. I reinitialize it often to show the complex search result (the search is not based on datatables plugin methods, I just clean html-table, fill it again and initialize datatable with html-sourced data). So if I do the search 3-5 times in a row, the page quits responding and there a lot of abovementioned warnings in the log.

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin

    See also this github issue (ideally it should have been posted here like you did - thanks!).

    I will look into this and post back when done, although I'm afraid I can't say when exactly that will be.

    Allan

This discussion has been closed.