fix: KsDataGrid - improve focusRow edit mode reliability with retry logic

- Use multiple setTimeout attempts to ensure startEditingCell succeeds
- Retry at 10ms and 50ms intervals for DOM/Grid stability
- Addresses issue where keyboard input not available after focusRow
This commit is contained in:
2026-08-16 21:24:29 +09:00
parent 55341661fc
commit 43e239d5e4
@@ -158,13 +158,16 @@ function focusRow(rowIndex: number, colKey?: string): void {
const col = colKey || (props.columns[0]?.field ?? '')
gridApi.value.ensureIndexVisible(rowIndex)
gridApi.value.setFocusedCell(rowIndex, col)
if (col) {
setTimeout(() => {
gridApi.value?.startEditingCell({ rowIndex, colKey: col })
}, 0)
const attempt = () => {
if (!gridApi.value) return
gridApi.value.setFocusedCell(rowIndex, col)
gridApi.value.startEditingCell({ rowIndex, colKey: col })
}
attempt()
setTimeout(attempt, 10)
setTimeout(attempt, 50)
}
function redrawRows(): void {