From 044e6ba9cd217a079d99a2274b3bf5f5e6d70875 Mon Sep 17 00:00:00 2001 From: Jessica Date: Tue, 19 Feb 2019 16:36:43 +0900 Subject: [PATCH] Pass options to scrollIntoView --- src/devtools/views/Element.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/devtools/views/Element.js b/src/devtools/views/Element.js index 4fa325599d..c1f03c2f32 100644 --- a/src/devtools/views/Element.js +++ b/src/devtools/views/Element.js @@ -55,7 +55,11 @@ export default function ElementView({ index, style }: Props) { const component = useRef(null); useEffect(() => { if (isSelected && component.current !== null) { - component.current.scrollIntoView(); + component.current.scrollIntoView({ + behavior: 'smooth', + block: 'center', + inline: 'center', + }); } }, [isSelected]);