From 95ef9bf585efb9573e7e38e7c1285250d05d4308 Mon Sep 17 00:00:00 2001 From: Luke De Feo Date: Fri, 17 Feb 2023 04:10:17 -0800 Subject: [PATCH] Preserve scroll position after exiting focus mode Summary: Previously we would scroll back to the top of the list Reviewed By: passy, ivanmisuno Differential Revision: D43390481 fbshipit-source-id: ce2d5d57d35b22e87a538720fe2760707a6bc058 --- desktop/plugins/public/ui-debugger/components/Tree.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop/plugins/public/ui-debugger/components/Tree.tsx b/desktop/plugins/public/ui-debugger/components/Tree.tsx index 396344a26..944547f66 100644 --- a/desktop/plugins/public/ui-debugger/components/Tree.tsx +++ b/desktop/plugins/public/ui-debugger/components/Tree.tsx @@ -113,7 +113,7 @@ export function Tree2({nodes, rootId}: {nodes: Map; rootId: Id}) { // otherwise we will keep scrolling back to the selected node overriding the users manual scroll offset. // We only should scroll when selection changes // eslint-disable-next-line react-hooks/exhaustive-deps - }, [selectedNode]); + }, [selectedNode, focusedNode]); return (