From 55341661fc53b6edc11f0dbb487bfa1ee29f4ab4 Mon Sep 17 00:00:00 2001 From: kjh2064 Date: Sun, 16 Aug 2026 21:22:40 +0900 Subject: [PATCH] fix: KsDataGrid - ensure edit mode starts after focusing and Enter key navigation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add setTimeout in focusRow to ensure DOM updates before startEditingCell - Add startEditingCell after tabToNextCell in Enter key handler - Ensures smooth edit mode transition: focus → edit mode immediately --- frontend/src/shared/ui/components/KsDataGrid.vue | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/frontend/src/shared/ui/components/KsDataGrid.vue b/frontend/src/shared/ui/components/KsDataGrid.vue index a80204ca..7db398e5 100644 --- a/frontend/src/shared/ui/components/KsDataGrid.vue +++ b/frontend/src/shared/ui/components/KsDataGrid.vue @@ -117,6 +117,13 @@ function onCellKeyDown(event: any): void { event.event.preventDefault() event.api.stopEditing(false) event.api.tabToNextCell(false) + + setTimeout(() => { + const focusedCell = event.api.getFocusedCell() + if (focusedCell && focusedCell.rowIndex !== null) { + event.api.startEditingCell({ rowIndex: focusedCell.rowIndex, colKey: focusedCell.column.getColId() }) + } + }, 0) } } @@ -152,8 +159,11 @@ function focusRow(rowIndex: number, colKey?: string): void { gridApi.value.ensureIndexVisible(rowIndex) gridApi.value.setFocusedCell(rowIndex, col) + if (col) { - gridApi.value.startEditingCell({ rowIndex, colKey: col }) + setTimeout(() => { + gridApi.value?.startEditingCell({ rowIndex, colKey: col }) + }, 0) } }