dbeaver/pro#6472 fix: restore focus after menu actions and on syncFocus (#3657)

* dbeaver/pro#6472 fix: restore focus after menu actions and on syncFocus

* dbeaver/pro#6472 refactor: revert changes with using restoreFocus function from context

* dbeaver/pro#6472 fix: delete row from a context menu works as with a hotkey

set to null and revert also keep focus in place

* Revert "dbeaver/pro#6472 fix: delete row from a context menu works as with a hotkey"

This reverts commit f54abf3956.

---------

Co-authored-by: Evgenia <139753579+EvgeniaBzzz@users.noreply.github.com>
This commit is contained in:
Sychev Andrey
2025-08-19 18:03:41 +08:00
committed by GitHub
co-authored by Evgenia
parent 69d7a25fec
commit 901669b802
3 changed files with 4 additions and 3 deletions
@@ -37,7 +37,7 @@ export class DataGridContextMenuCellEditingService {
constructor(
private readonly actionService: ActionService,
private readonly menuService: MenuService,
) {}
) { }
register(): void {
this.menuService.addCreator({
@@ -200,6 +200,7 @@ export const DataGridTable = observer<IDataPresentationProps>(function DataGridT
// TODO: we need this delay to update focus after render rows update
setTimeout(() => {
handlers.focusCell(data.key);
setTimeout(() => restoreFocus(), 1);
}, 1);
}
}
@@ -210,7 +211,7 @@ export const DataGridTable = observer<IDataPresentationProps>(function DataGridT
return () => {
tableData.editor.action.removeHandler(syncEditor);
};
}, [tableData.editor, selectionAction, handlers, tableData]);
}, [tableData.editor, selectionAction, handlers, tableData, restoreFocus]);
const handleFocusChange = (position: ICellPosition) => {
focusedCell.current = position;
@@ -1,6 +1,6 @@
/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2024 DBeaver Corp and others
* Copyright (C) 2020-2025 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.