Skip to content

Commit 2a66fbd

Browse files
committed
Fix using BACKSPACE key in input dialogs
1 parent 5739dff commit 2a66fbd

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Input/InputIO.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,11 @@ public function collect(Input $input) : InputResult
7575
}
7676

7777
case InputCharacter::BACKSPACE:
78-
$inputValue = substr($inputValue, 0, -1);
79-
$this->parentMenu->redraw();
80-
$this->drawInput($input, $inputValue);
78+
if (!empty($inputValue)) {
79+
$inputValue = substr($inputValue, 0, -1);
80+
$this->parentMenu->redraw();
81+
$this->drawInput($input, $inputValue);
82+
}
8183
continue 2;
8284
}
8385

0 commit comments

Comments
 (0)