Skip to content

Commit 7527306

Browse files
committed
Remove scrollToPosition prop
1 parent 64ceff0 commit 7527306

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/index.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,10 @@ export interface Props {
2828
redBtnCallback?: () => void;
2929
yellowBtnCallback?: () => void;
3030
greenBtnCallback?: () => void;
31-
scrollToPosition?: boolean;
3231
TopButtonsPanel?: (props: IWindowButtonsProps) => ReactElement | null;
3332
}
3433

35-
const Terminal = ({name, prompt, height = "600px", colorMode, onInput, children, startingInputValue = "", redBtnCallback, yellowBtnCallback, greenBtnCallback, scrollToPosition = true, TopButtonsPanel = WindowButtons}: Props) => {
34+
const Terminal = ({name, prompt, height = "600px", colorMode, onInput, children, startingInputValue = "", redBtnCallback, yellowBtnCallback, greenBtnCallback, TopButtonsPanel = WindowButtons}: Props) => {
3635
const [currentLineInput, setCurrentLineInput] = useState('');
3736
const [cursorPos, setCursorPos] = useState(0);
3837

@@ -72,10 +71,7 @@ const Terminal = ({name, prompt, height = "600px", colorMode, onInput, children,
7271
onInput(currentLineInput);
7372
setCursorPos(0);
7473
setCurrentLineInput('');
75-
if (scrollToPosition) {
76-
setTimeout(() => scrollIntoViewRef?.current?.scrollIntoView({ behavior: "auto", block: "nearest" }), 500);
77-
}
78-
74+
setTimeout(() => scrollIntoViewRef?.current?.scrollIntoView({ behavior: "auto", block: "nearest" }), 500);
7975
} else if (["ArrowLeft", "ArrowRight", "ArrowDown", "ArrowUp", "Delete"].includes(event.key)) {
8076
const inputElement = event.currentTarget;
8177
let charsToRightOfCursor = "";

0 commit comments

Comments
 (0)