Skip to content

Commit 4130281

Browse files
authored
fix(web-console): grid unresponsiveness after scroll (#425)
1 parent 67f573b commit 4130281

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

  • packages/web-console/src/js/console

packages/web-console/src/js/console/grid.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ export function grid(rootElement, _paginationFn, id) {
320320
const colLo = Math.max(visColumnLo, freezeLeft)
321321
const colHi = Math.min(colLo + visColumnCount, columnCount)
322322
renderCells(rows, colLo, colHi, visColumnLo)
323+
scroll()
323324
}
324325

325326
function purgeOutlierPages() {
@@ -1047,7 +1048,11 @@ export function grid(rootElement, _paginationFn, id) {
10471048
}
10481049

10491050
function renderFocusedCell() {
1050-
addClass(focusedCell, ACTIVE_CELL_CLASS)
1051+
if (focusedCell && focusedCell.parentElement && focusedCell.parentElement.rowIndex === focusedRowIndex) {
1052+
addClass(focusedCell, ACTIVE_CELL_CLASS)
1053+
} else if (focusedCell) {
1054+
removeClass(focusedCell, ACTIVE_CELL_CLASS)
1055+
}
10511056
}
10521057

10531058
function setFocusedCell(cell) {
@@ -1243,7 +1248,11 @@ export function grid(rootElement, _paginationFn, id) {
12431248

12441249
function setRowActive(rows) {
12451250
const row = rows[focusedRowIndex & dcn]
1246-
row.className = "qg-r qg-r-active"
1251+
if (row && row.rowIndex === focusedRowIndex) {
1252+
row.className = "qg-r qg-r-active"
1253+
} else if (row) {
1254+
row.className = "qg-r"
1255+
}
12471256
return row
12481257
}
12491258

0 commit comments

Comments
 (0)