mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Use smart scrolling
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user