Pass options to scrollIntoView
Jessica committed
Feb 19, 2019 at 16:36 UTC
044e6ba9cd217a079d99a2274b3bf5f5e6d70875
1 file changed
+5
-1
src/devtools/views/Element.js
+5
-1
@@ -55,7 +55,11 @@ export default function ElementView({ index, style }: Props) {
55
const component = useRef(null);
56
useEffect(() => {
57
if (isSelected && component.current !== null) {
58
- component.current.scrollIntoView();
58
+ component.current.scrollIntoView({
59
+ behavior: 'smooth',
60
+ block: 'center',
61
+ inline: 'center',
62
+ });
63
}
64
}, [isSelected]);
65