fix(fe): KsDataGrid - prevent duplicate edit mode on cell focus
deploy / deploy (push) Failing after 46s
deploy / notify (push) Successful in 0s

Improved onCellFocused to check if already editing same cell before starting edit mode.

Problem: Enter key moves to next cell + startEditingCell(), then onCellFocused fires
and tries to startEditingCell() again on same cell, causing timing issues.

Solution: Check getEditingCell() to see if we're already editing the focused cell
- If same cell: skip (already editing)
- If different cell: enter edit mode

Result: Enter key → next cell → auto edit mode (no duplication)
Tab/Click/Arrow → auto edit mode (only once)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-08-16 20:47:07 +09:00
parent 3a1340eabd
commit 844f1eae4a
@@ -117,12 +117,19 @@ function onCellFocused(event: CellFocusedEvent): void {
if (event.column && event.rowIndex !== undefined) {
const colDef = event.column.getColDef()
if (colDef.editable) {
setTimeout(() => {
const currentEditingCell = event.api.getEditingCell()
const focusedColId = event.column.getColId()
const isSameCell = currentEditingCell &&
currentEditingCell.rowIndex === event.rowIndex &&
currentEditingCell.column?.getColId() === focusedColId
if (!isSameCell) {
event.api.startEditingCell({
rowIndex: event.rowIndex,
colKey: event.column!.getColId()
colKey: focusedColId
})
}, 50)
}
}
}
}