fix(fe): KsDataGrid - Enter key uses Tab navigation (suggestedNextCell)
deploy / deploy (push) Failing after 49s
deploy / notify (push) Successful in 0s

Simplified navigateToNextCell to let Enter key use default AG Grid Tab behavior.

Previous: Custom Enter navigation (next editable column only)
New: Return suggestedNextCell for Enter, which is Tab's default behavior

This makes Enter and Tab fully equivalent, consistent with user expectation.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-08-16 20:50:59 +09:00
parent 69cee5a159
commit 56a5eb9391
@@ -190,34 +190,10 @@ import type { NavigateToNextCellParams, CellPosition } from 'ag-grid-community'
function navigateToNextCell(params: NavigateToNextCellParams): CellPosition | null {
const previousCell = params.previousCellPosition
const suggestedNextCell = params.nextCellPosition
if (params.key === 'Enter' || String(params.key) === '13') {
const allColumns = params.api.getAllGridColumns()
const editableCols = allColumns.filter(c => {
const colDef = c.getColDef()
return colDef.editable === true || typeof colDef.editable === 'function'
})
if (editableCols.length > 0) {
const currentColId = previousCell.column.getColId()
const currentIndex = editableCols.findIndex(c => c.getColId() === currentColId)
if (currentIndex >= 0 && currentIndex < editableCols.length - 1) {
const nextCol = editableCols[currentIndex + 1]
const colId = nextCol.getColId()
setTimeout(() => {
params.api.startEditingCell({ rowIndex: previousCell.rowIndex, colKey: colId })
}, 30)
return {
rowIndex: previousCell.rowIndex,
column: nextCol,
rowPinned: previousCell.rowPinned
}
}
return null
}
return suggestedNextCell
}
return suggestedNextCell