Skip to content

Commit 266336a

Browse files
authored
Merge pull request #267 from tbannister/backspace-fix
Fix backspace on empty input issue.
2 parents 8472f6d + 12c3a8b commit 266336a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Input/InputIO.php

+3
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ public function collect(Input $input) : InputResult
7777
case InputCharacter::BACKSPACE:
7878
if (!empty($inputValue)) {
7979
$inputValue = substr($inputValue, 0, -1);
80+
if (!is_string($inputValue)) {
81+
$inputValue = '';
82+
}
8083
$this->parentMenu->redraw();
8184
$this->drawInput($input, $inputValue);
8285
}

0 commit comments

Comments
 (0)