Skip to content

Commit 3e86d30

Browse files
authored
fix(browser-repl): use block: nearest for scrollIntoView vertical alignment behavior COMPASS-9417 (#2469)
1 parent d604dd2 commit 3e86d30

File tree

1 file changed

+5
-1
lines changed
  • packages/browser-repl/src/components

1 file changed

+5
-1
lines changed

packages/browser-repl/src/components/shell.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,11 @@ const _Shell: ForwardRefRenderFunction<EditorRef | null, ShellProps> = (
446446
return;
447447
}
448448

449-
shellInputContainerRef.current.scrollIntoView();
449+
shellInputContainerRef.current.scrollIntoView({
450+
// Scroll to the bottom of the shell input container.
451+
// Or maintain scroll if already in the input.
452+
block: 'nearest',
453+
});
450454
}, [shellInputContainerRef]);
451455

452456
const onShellClicked = useCallback(

0 commit comments

Comments
 (0)