Skip to content

Commit

Permalink
Update scrolling for api commands
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mjh316 authored May 16, 2022
1 parent 5d649cd commit fe5e6f4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ const IndexPage: React.FC<IndexPageProps> = ({ inputRef }) => {

React.useEffect(() => {
if (inputRef.current) {
inputRef.current.focus();
inputRef.current.scrollIntoView();
inputRef.current.focus({preventScroll: true});
}
}, [history]);

Expand Down

0 comments on commit fe5e6f4

Please sign in to comment.