Better scroll area

This commit is contained in:
Daniel Kluge 2021-12-26 15:16:09 +01:00
parent b9e4a4558c
commit ee500ebeea
3 changed files with 9 additions and 3 deletions

View File

@ -1,6 +1,7 @@
import { useRef, useState } from "react"; import { useRef, useState } from "react";
import REPLInput from "./REPLInput"; import REPLInput from "./REPLInput";
import REPLHistory from "./REPLHistory"; import REPLHistory from "./REPLHistory";
import styles from "../../styles/REPL/REPLComplete.module.css";
const REPL = () => { const REPL = () => {
const [history, manipulateHistory] = useState<string[]>([]); const [history, manipulateHistory] = useState<string[]>([]);
@ -12,11 +13,11 @@ const REPL = () => {
if (inputRef.current) inputRef.current.focus(); if (inputRef.current) inputRef.current.focus();
} }
return (<> return (<div className={styles.container}>
<REPLHistory history={history} inputRef={inputRef} /> <REPLHistory history={history} inputRef={inputRef} />
<REPLInput historyCallback={onCommandExecuted} historyClear={onClearHistory} inputRef={inputRef} /> <REPLInput historyCallback={onCommandExecuted} historyClear={onClearHistory} inputRef={inputRef} />
<div style={{flexGrow: 2}} onClick={focusInput}></div> <div style={{flexGrow: 2}} onClick={focusInput}></div>
</>); </div>);
}; };
export default REPL; export default REPL;

View File

@ -0,0 +1,6 @@
.container {
overflow-y: auto;
display: flex;
flex-direction: column;
flex-grow: 2;
}

View File

@ -1,5 +1,4 @@
.container { .container {
overflow: auto;
display: flex; display: flex;
flex-direction: column-reverse; flex-direction: column-reverse;
flex-shrink: 2; flex-shrink: 2;