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.tabToNextCell(false)
|
||||
|
||||
const ensureEditMode = () => {
|
||||
const attempt = () => {
|
||||
const focusedCell = event.api.getFocusedCell()
|
||||
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()
|
||||
setTimeout(ensureEditMode, 10)
|
||||
setTimeout(ensureEditMode, 50)
|
||||
attempt()
|
||||
setTimeout(attempt, 10)
|
||||
setTimeout(attempt, 50)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user