diff --git a/webapp/packages/plugin-data-spreadsheet-new/src/DataGrid/CellEditor/CellEditor.tsx b/webapp/packages/plugin-data-spreadsheet-new/src/DataGrid/CellEditor/CellEditor.tsx index 6a990abcb4..b95312cb32 100644 --- a/webapp/packages/plugin-data-spreadsheet-new/src/DataGrid/CellEditor/CellEditor.tsx +++ b/webapp/packages/plugin-data-spreadsheet-new/src/DataGrid/CellEditor/CellEditor.tsx @@ -25,7 +25,7 @@ const styles = css` } box { position: absolute; - left: 0; + left: -8px; top: 0; width: 0; height: 100%; diff --git a/webapp/packages/plugin-data-spreadsheet-new/src/DataGrid/Formatters/CellFormatter.tsx b/webapp/packages/plugin-data-spreadsheet-new/src/DataGrid/Formatters/CellFormatter.tsx index b90fd0b7b0..11b9698c32 100644 --- a/webapp/packages/plugin-data-spreadsheet-new/src/DataGrid/Formatters/CellFormatter.tsx +++ b/webapp/packages/plugin-data-spreadsheet-new/src/DataGrid/Formatters/CellFormatter.tsx @@ -30,6 +30,7 @@ const styles = css` flex: 1; display: flex; overflow: hidden; + position: relative; } formatter-container { flex: 1; @@ -57,7 +58,7 @@ export const CellFormatter: React.FC = observer(function CellFormatter({ } const idx = tableDataContext.getColumnIndexFromColumnKey(position.column); - const rowIdx = tableDataContext.getRowIndexFromKey(position.column); + const rowIdx = tableDataContext.getRowIndexFromKey(position.row); if (idx !== -1) { editingContext.edit({ idx, rowIdx }); diff --git a/webapp/packages/plugin-data-spreadsheet-new/src/DataGrid/useTableData.ts b/webapp/packages/plugin-data-spreadsheet-new/src/DataGrid/useTableData.ts index fc8d7194bb..4874089559 100644 --- a/webapp/packages/plugin-data-spreadsheet-new/src/DataGrid/useTableData.ts +++ b/webapp/packages/plugin-data-spreadsheet-new/src/DataGrid/useTableData.ts @@ -123,8 +123,11 @@ export function useTableData(model: IDatabaseDataModel, return this.columns.findIndex(column => column.key === key); }, getColumnIndexFromColumnKey(columnKey) { - return this.columnKeys - .findIndex(column => ResultSetDataKeysUtils.isEqual(columnKey, column)); + return this.columns + .findIndex(column => ( + column.columnDataIndex !== null + && ResultSetDataKeysUtils.isEqual(columnKey, column.columnDataIndex) + )); }, getRowIndexFromKey(rowKey) { return this.rows.findIndex(row => ResultSetDataKeysUtils.isEqual(rowKey, row));