fix: KsDataGrid - replicate focusRow complete logic in Enter key handler
- Use exact focusRow pattern: ensureIndexVisible + setFocusedCell + startEditingCell - Apply retry logic to all three operations - Ensures next cell gets full focus + edit mode like focusRow
This commit is contained in:
@@ -118,16 +118,20 @@ function onCellKeyDown(event: any): void {
|
|||||||
event.api.stopEditing(false)
|
event.api.stopEditing(false)
|
||||||
event.api.tabToNextCell(false)
|
event.api.tabToNextCell(false)
|
||||||
|
|
||||||
const ensureEditMode = () => {
|
const attempt = () => {
|
||||||
const focusedCell = event.api.getFocusedCell()
|
const focusedCell = event.api.getFocusedCell()
|
||||||
if (focusedCell) {
|
if (focusedCell) {
|
||||||
event.api.startEditingCell(focusedCell)
|
const col = focusedCell.column.getColId()
|
||||||
|
const rowIndex = focusedCell.rowIndex
|
||||||
|
event.api.ensureIndexVisible(rowIndex)
|
||||||
|
event.api.setFocusedCell(rowIndex, col)
|
||||||
|
event.api.startEditingCell({ rowIndex, colKey: col })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ensureEditMode()
|
attempt()
|
||||||
setTimeout(ensureEditMode, 10)
|
setTimeout(attempt, 10)
|
||||||
setTimeout(ensureEditMode, 50)
|
setTimeout(attempt, 50)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user