mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
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:
+1
-1
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user