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
|
|
@ -5,6 +5,7 @@ import {
|
|||
buildCircuitEditPatch,
|
||||
buildDeviceRowEditPatch,
|
||||
formatValue,
|
||||
isGridEditorControlTarget,
|
||||
getBlockSortValue,
|
||||
getCellKind,
|
||||
getCircuitValue,
|
||||
|
|
@ -50,6 +51,18 @@ const circuit: CircuitTreeCircuitDto = {
|
|||
};
|
||||
|
||||
describe("circuit grid model", () => {
|
||||
it("does not route clicks from active editor controls back to the grid cell", () => {
|
||||
const inputTarget = {
|
||||
closest: (selector: string) =>
|
||||
selector === "input, select, textarea" ? {} : null,
|
||||
};
|
||||
const cellTarget = { closest: () => null };
|
||||
|
||||
assert.equal(isGridEditorControlTarget(inputTarget), true);
|
||||
assert.equal(isGridEditorControlTarget(cellTarget), false);
|
||||
assert.equal(isGridEditorControlTarget(null), false);
|
||||
});
|
||||
|
||||
it("keeps the equipment identifier locked as the first column", () => {
|
||||
assert.equal(allColumns[0].key, "equipmentIdentifier");
|
||||
assert.equal(allColumns[0].locked, true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue