From fe5e6f46186a397cf43b4570cd15fd3c7230481f Mon Sep 17 00:00:00 2001 From: mjh <61671361+mjh316@users.noreply.github.com> Date: Mon, 16 May 2022 07:08:01 -0700 Subject: [PATCH] Update scrolling for api commands When you run a command such as `help`, the terminal will automatically scroll down to the bottom of the output and to the next prompt. This doesn't happen for api commands such as `weather Miami`. This PR changes that and matches the api command behavior to the regular ones. --- src/pages/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/index.tsx b/src/pages/index.tsx index aef075d..b81c09e 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -30,7 +30,8 @@ const IndexPage: React.FC = ({ inputRef }) => { React.useEffect(() => { if (inputRef.current) { - inputRef.current.focus(); + inputRef.current.scrollIntoView(); + inputRef.current.focus({preventScroll: true}); } }, [history]);