From 8aad550c777c81b2b435d64e537651abbaf67042 Mon Sep 17 00:00:00 2001 From: kjh2064 Date: Sun, 16 Aug 2026 21:04:41 +0900 Subject: [PATCH] refactor: KsDataGrid - simplify focusRow and rely on AG Grid native Enter navigation --- .../src/shared/ui/components/KsDataGrid.vue | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/frontend/src/shared/ui/components/KsDataGrid.vue b/frontend/src/shared/ui/components/KsDataGrid.vue index cc47aae8..21748a0e 100644 --- a/frontend/src/shared/ui/components/KsDataGrid.vue +++ b/frontend/src/shared/ui/components/KsDataGrid.vue @@ -112,7 +112,6 @@ function onCellValueChanged(event: CellValueChangedEvent): void { } } - function onSortChanged(params: { api: { redrawRows: () => void; refreshCells: (options: { force: boolean }) => void } }): void { params.api.redrawRows() } @@ -139,25 +138,15 @@ function onGridReady(params: GridReadyEvent): void { params.api.sizeColumnsToFit() } - - - function focusRow(rowIndex: number, colKey?: string): void { if (!gridApi.value) return const col = colKey || (props.columns[0]?.field ?? '') - const attempt = () => { - if (!gridApi.value) return - gridApi.value.ensureIndexVisible(rowIndex) - if (col) { - gridApi.value.setFocusedCell(rowIndex, col) - gridApi.value.startEditingCell({ rowIndex, colKey: col }) - } + gridApi.value.ensureIndexVisible(rowIndex) + if (col) { + gridApi.value.setFocusedCell(rowIndex, col) + gridApi.value.startEditingCell({ rowIndex, colKey: col }) } - - attempt() - setTimeout(attempt, 50) - setTimeout(attempt, 150) } function redrawRows(): void {