fix(accounts): clear multi-selection globally on Escape
Route account selection clearing through the existing window-level Escape handler so it works regardless of which account surface owns focus. Preserve text editing and open overlay behavior, and remove the misleading focus-dependent workspace handler.
This commit is contained in:
@@ -301,7 +301,6 @@ function workspaceActions(overrides: Partial<AccountWorkspaceActions> = {}): Acc
|
||||
return {
|
||||
onPanelChange: () => {},
|
||||
onSelect: () => {},
|
||||
onClearSelection: () => {},
|
||||
onToggleEnabled: () => {},
|
||||
onEdit: () => {},
|
||||
onContextMenu: () => {},
|
||||
@@ -799,18 +798,15 @@ describe("account workspace", () => {
|
||||
]);
|
||||
});
|
||||
|
||||
it("shows the selected account count and clears the selection with Escape", () => {
|
||||
let cleared = 0;
|
||||
it("shows the selected account count", () => {
|
||||
const model = workspaceModel();
|
||||
const tree = AccountWorkspace({
|
||||
actions: workspaceActions({ onClearSelection: () => { cleared += 1; } }),
|
||||
actions: workspaceActions(),
|
||||
model: { ...model, selectedIds: model.rows.slice(0, 3).map((row) => row.id) }
|
||||
});
|
||||
const html = renderToStaticMarkup(tree);
|
||||
|
||||
expect(html).toContain("− Entfernen (3)");
|
||||
tree.props.onKeyDown({ key: "Escape", preventDefault: () => {} });
|
||||
expect(cleared).toBe(1);
|
||||
});
|
||||
|
||||
it("removes the redundant global account activation switch", () => {
|
||||
|
||||
Reference in New Issue
Block a user