diff --git a/src/Themes/Default/TextareaPromptRenderer.php b/src/Themes/Default/TextareaPromptRenderer.php index fdbcfe38..e97a61d7 100644 --- a/src/Themes/Default/TextareaPromptRenderer.php +++ b/src/Themes/Default/TextareaPromptRenderer.php @@ -57,8 +57,14 @@ public function __invoke(TextareaPrompt $prompt): string protected function renderText(TextareaPrompt $prompt): string { + $visible = collect($prompt->visible()); + + while ($visible->count() < $prompt->scroll) { + $visible->push(''); + } + return $this->scrollbar( - collect($prompt->visible()), + $visible, $prompt->firstVisible, $prompt->scroll, count($prompt->lines()),