@samitouri / QOS-React-2 / commits / 403f150ade

Use smart scrolling

Dan Abramov committed Apr 12, 2019 at 18:13 UTC 403f150ade08082c6d2bc5a5104e59e045fe8189
1 file changed +1 -1
src/devtools/views/Components/Tree.js
+1 -1
@@ -68,7 +68,7 @@ export default function Tree(props: Props) {
68 // This is helpful for things like the owners list and search.
69 useLayoutEffect(() => {
70 if (selectedElementIndex !== null && listRef.current != null) {
71 - listRef.current.scrollToItem(selectedElementIndex);
71 + listRef.current.scrollToItem(selectedElementIndex, 'smart');
72 // Note this autoscroll only works for rows.
73 // There's another autoscroll inside the elements
74 // that ensures the component name is visible horizontally.