Application crashes with empty Grid in development mode
Closed this issue · 1 comments
insmac commented
Steps to reproduce: (note: this happens in development mode only)
- Make sure there are no records and no columns in the grid (i.e. refresh the Console).
- Go to any page other than the sql editor: Import or Settings.
- Go back to the editor. The application will crash with the following JavaScript error in Developer Console:
The issue seems to be caused by this code in grid.js
function setFocusedColumn(columnIndex) {
if (columnIndex !== -1) {
focusedColumnIndex = columnIndex
const cell = focusedColumnIndex < freezeLeft ? focusedRowContainerLeft.childNodes[focusedColumnIndex] : focusedRowContainer.childNodes[focusedColumnIndex % visColumnCount]
cell.columnIndex = focusedColumnIndex
setFocusedCell(cell)
}
}
cell
conditional (focusedColumnIndex < freezeLeft
) evaluates to false
and breaks down on focusedColumnIndex % visColumnCount
which equals to NaN
.