#254 tab navigation in datagrid

This commit is contained in:
Jan Prochazka 2022-03-31 16:01:06 +02:00
parent c0b365602b
commit 1a035ca168

View File

@ -1139,7 +1139,7 @@
handleCursorMove(event);
if (event.shiftKey && event.keyCode != keycodes.shift) {
if (event.shiftKey && event.keyCode != keycodes.shift && event.keyCode != keycodes.tab) {
selectedCells = getCellRange(shiftDragStartCell || currentCell, currentCell);
}
}
@ -1188,6 +1188,21 @@
return moveCurrentCell(currentCell[0] - visibleRowCountLowerBound, currentCell[1], event);
case keycodes.pageDown:
return moveCurrentCell(currentCell[0] + visibleRowCountLowerBound, currentCell[1], event);
case keycodes.tab: {
if (event.shiftKey) {
if (currentCell[1] > 0) {
return moveCurrentCell(currentCell[0], currentCell[1] - 1, event);
} else {
return moveCurrentCell(currentCell[0] - 1, columnSizes.realCount - 1, event);
}
} else {
if (currentCell[1] < columnSizes.realCount - 1) {
return moveCurrentCell(currentCell[0], currentCell[1] + 1, event);
} else {
return moveCurrentCell(currentCell[0] + 1, 0, event);
}
}
}
}
}
return null;