mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
fix(core-app): CB-668 navigation tree select & expand behavior
This commit is contained in:
@@ -99,7 +99,12 @@ export function useNavigationNode(node: NavNode): INavigationNode {
|
||||
if (node && context?.isSelected?.(node)) {
|
||||
context.onSelect?.(node, true);
|
||||
}
|
||||
}, [context, node]);
|
||||
}, [context, node.id]);
|
||||
|
||||
useEffect(() => () => {
|
||||
// TODO: seems like selection & expand should be specific for separate tree definitions
|
||||
navigationTreeService.expandNode(node.id, false);
|
||||
}, [node.id]);
|
||||
|
||||
return {
|
||||
control: context?.control,
|
||||
|
||||
@@ -69,6 +69,11 @@ export class NavigationTreeService {
|
||||
this.navigationTreeMetadata.delete(key);
|
||||
});
|
||||
});
|
||||
this.navTreeResource.onItemDelete.addHandler(key => {
|
||||
ResourceKeyUtils.forEach(key, key => {
|
||||
this.expandNode(key, false);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
getChildren(id: string): string[] | undefined {
|
||||
|
||||
Reference in New Issue
Block a user