forked from jappel/leistungsbilanz-ts
Preserve focus inside grid editors
This commit is contained in:
parent
096ba8aa1c
commit
1b2ca84258
3 changed files with 33 additions and 1 deletions
|
|
@ -27,6 +27,7 @@ import {
|
|||
deviceFieldKeys,
|
||||
formatPhaseTypeLabel,
|
||||
formatValue,
|
||||
isGridEditorControlTarget,
|
||||
} from "../utils/circuit-grid-model";
|
||||
import {
|
||||
buildCircuitDeviceRowInsertSnapshot,
|
||||
|
|
@ -3398,6 +3399,9 @@ export function CircuitTreeEditor(props: { projectId: string; circuitListId: str
|
|||
setCircuitReorderIntent(null);
|
||||
}}
|
||||
onClick={(event) => {
|
||||
if (isGridEditorControlTarget(event.target)) {
|
||||
return;
|
||||
}
|
||||
if (cell.editable) {
|
||||
handleRowSelectionClick(row, column.key, {
|
||||
ctrlKey: event.ctrlKey,
|
||||
|
|
@ -3406,7 +3410,10 @@ export function CircuitTreeEditor(props: { projectId: string; circuitListId: str
|
|||
});
|
||||
}
|
||||
}}
|
||||
onDoubleClick={() => {
|
||||
onDoubleClick={(event) => {
|
||||
if (isGridEditorControlTarget(event.target)) {
|
||||
return;
|
||||
}
|
||||
if (cell.editable) {
|
||||
startEdit({ rowKey: row.rowKey, cellKey: column.key }, "selectExisting");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue