mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
fix: CB-1151 cell editing
This commit is contained in:
@@ -25,7 +25,7 @@ const styles = css`
|
||||
}
|
||||
box {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
left: -8px;
|
||||
top: 0;
|
||||
width: 0;
|
||||
height: 100%;
|
||||
|
||||
+2
-1
@@ -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<Props> = 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 });
|
||||
|
||||
@@ -123,8 +123,11 @@ export function useTableData(model: IDatabaseDataModel<any, IDatabaseResultSet>,
|
||||
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));
|
||||
|
||||
Reference in New Issue
Block a user