Skip to content

Commit

Permalink
fix: TypeError: Cannot read properties of null (reading 'classList')
Browse files Browse the repository at this point in the history
Sentry PRESS-4KJ / Support 10958

TypeError: Cannot read properties of null (reading 'classList')
  at ? (../../../../../apps/frappe/node_modules/frappe-datatable/dist/frappe-datatable.cjs.js:2940:37)
  at Array.forEach(<anonymous>)
  at Ye.clearSelection(../../../../../apps/frappe/node_modules/frappe-datatable/dist/frappe-datatable.cjs.js:2940:14)
  at Ye._selectArea(../../../../../apps/frappe/node_modules/frappe-datatable/dist/frappe-datatable.cjs.js:2877:14)
  at Ye.selectArea(../../../../../apps/frappe/node_modules/frappe-datatable/dist/frappe-datatable.cjs.js:2865:18)
  at HTMLDivElement.t(../../../../../apps/frappe/node_modules/frappe-datatable/dist/frappe-datatable.cjs.js:2723:18)
  at invokeFunc(../../../../../apps/frappe/node_modules/frappe-datatable/dist/frappe-datatable.cjs.js:632:19)
  at trailingEdge(../../../../../apps/frappe/node_modules/frappe-datatable/dist/frappe-datatable.cjs.js:681:14)
  at timerExpired(../../../../../apps/frappe/node_modules/frappe-datatable/dist/frappe-datatable.cjs.js:669:14)
  at r(../../../../../apps/frappe/node_modules/src/helpers.ts:98:1)

Signed-off-by: Akhil Narang <[email protected]>
  • Loading branch information
akhilnarang committed Mar 6, 2024
1 parent dbde62c commit 718838d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/cellmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,11 @@ export default class CellManager {

clearSelection() {
(this._selectedCells || [])
.forEach($cell => $cell.classList.remove('dt-cell--highlight'));

.forEach($cell => {
if ($cell && $cell.classList) {
$cell.classList.remove('dt-cell--highlight');
}
});
this._selectedCells = [];
this.$selectionCursor = null;
}
Expand Down

0 comments on commit 718838d

Please sign in to comment.