diff --git a/desktop/plugins/public/ui-debugger/components/Tree.tsx b/desktop/plugins/public/ui-debugger/components/Tree.tsx index 5cfc1db63..396344a26 100644 --- a/desktop/plugins/public/ui-debugger/components/Tree.tsx +++ b/desktop/plugins/public/ui-debugger/components/Tree.tsx @@ -435,8 +435,8 @@ const ContextMenu: React.FC<{ }) => { const copyItems: ReactNode[] = []; const hoveredNode = nodes.get(hoveredNodeId ?? Number.MAX_SAFE_INTEGER); + if (hoveredNode) { - copyItems.push(); copyItems.push( { + onFocusNode(hoveredNodeId); + }} + /> + ); + + const removeFocus = focusedNodeId && ( + { + onFocusNode(undefined); + }} + /> + ); return ( { @@ -466,25 +488,9 @@ const ContextMenu: React.FC<{ }} overlay={() => ( - {hoveredNode != null && focusedNodeId !== hoveredNodeId && ( - { - onFocusNode(hoveredNodeId); - }} - /> - )} - - {focusedNodeId && ( - { - onFocusNode(undefined); - }} - /> - )} + {focus} + {removeFocus} + {(focus || removeFocus) && } {copyItems} )}