mini repl max height option

This commit is contained in:
Felix Roos 2024-01-21 01:21:13 +01:00
parent 18ae82174d
commit 6224cd40d4

View file

@ -27,6 +27,7 @@ export function MiniRepl({
punchcardLabels = true, punchcardLabels = true,
claviature, claviature,
claviatureLabels, claviatureLabels,
maxHeight,
}) { }) {
const code = tunes ? tunes[0] : tune; const code = tunes ? tunes[0] : tune;
const id = useMemo(() => s4(), []); const id = useMemo(() => s4(), []);
@ -154,7 +155,7 @@ export function MiniRepl({
)} )}
</div> </div>
)} )}
<div className="overflow-auto relative p-1"> <div className="overflow-auto relative p-1" style={maxHeight ? { maxHeight: `${maxHeight}px` } : {}}>
<div <div
ref={(el) => { ref={(el) => {
if (!editorRef.current) { if (!editorRef.current) {