tablesort
tablesort copied to clipboard
Incorrect determination of row type which can lead to errors
The code starting here https://github.com/tristen/tablesort/blob/72481c2bed958bf7728f092445a0e4dfb4f45936/src/tablesort.js#L168 (which collects items for determining the type of a row) does falsely collect items from rows marked with the class no-sort. This can lead to bogus determination of a column type, or worse: an error (like in my case). If a row marked with no-sort includes colspan'd columns, the expression that.table.tBodies[0].rows[i].cells[column] returns undefined, gets passed to getInnerText, were it ultimately leads to an error.
The fix would be to skip rows which are marked with no-sort in this loop.
A workaround is to set data-sort-method for all columns, so this piece of code is never run.