Closed strager closed 1 year ago
Sounds fixable it's because the browser extension applies table-sort tag to all tables. I could create a tbody if it doesn't exist (Like I do with <thead>
) ,or just exit out, or do a check for null before trying to grab tbody.
function makeTableSortable(sortableTable) {
const tableBody = getTableBody(sortableTable);
const tableHead = sortableTable.querySelector("thead");
const tableHeadHeaders = tableHead.querySelectorAll("th");
const tableRows = tableBody.querySelectorAll("tr");
It's this line here.
Should be fixed in: https://github.com/LeeWannacott/table-sort-js/pull/99
If I create a table without a
<tbody>
, the table-sort-js browser extension crashes withTypeError: tableBody is null
.