From 403f150ade08082c6d2bc5a5104e59e045fe8189 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Fri, 12 Apr 2019 18:13:26 +0100 Subject: [PATCH] Use smart scrolling --- src/devtools/views/Components/Tree.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/devtools/views/Components/Tree.js b/src/devtools/views/Components/Tree.js index dd3fe6255d..eb31803f23 100644 --- a/src/devtools/views/Components/Tree.js +++ b/src/devtools/views/Components/Tree.js @@ -68,7 +68,7 @@ export default function Tree(props: Props) { // This is helpful for things like the owners list and search. useLayoutEffect(() => { if (selectedElementIndex !== null && listRef.current != null) { - listRef.current.scrollToItem(selectedElementIndex); + listRef.current.scrollToItem(selectedElementIndex, 'smart'); // Note this autoscroll only works for rows. // There's another autoscroll inside the elements // that ensures the component name is visible horizontally.