From 43e239d5e434b49b8d0c0358b11f3d2832d0f410 Mon Sep 17 00:00:00 2001 From: kjh2064 Date: Sun, 16 Aug 2026 21:24:29 +0900 Subject: [PATCH] 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 --- frontend/src/shared/ui/components/KsDataGrid.vue | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/frontend/src/shared/ui/components/KsDataGrid.vue b/frontend/src/shared/ui/components/KsDataGrid.vue index 7db398e5..be73b532 100644 --- a/frontend/src/shared/ui/components/KsDataGrid.vue +++ b/frontend/src/shared/ui/components/KsDataGrid.vue @@ -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 {