Skip to content

Fix using BACKSPACE key in input dialogs #260

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 27, 2022

Conversation

simonovich
Copy link
Contributor

This hotfix provides a solution to the problem below

Problem:

  • Input error when using button BACKSPACE

Reproduce:

Hold down the BACKSPACE key in any input dialog from the examples folder.

Get error:

PHP Fatal error:  Uncaught TypeError: Argument 2 passed to PhpSchool\CliMenu\Input\InputIO::drawInput() must be of the type string, bool given, called in /opt/hg/cli-menu/src/Input/InputIO.php on line 80 and defined in /opt/hg/cli-menu/src/Input/InputIO.php:205
Stack trace:
#0 /opt/hg/cli-menu/src/Input/InputIO.php(80): PhpSchool\CliMenu\Input\InputIO->drawInput()
#1 /opt/hg/cli-menu/src/Input/Text.php(94): PhpSchool\CliMenu\Input\InputIO->collect()
#2 /opt/hg/cli-menu/examples/input-text.php(12): PhpSchool\CliMenu\Input\Text->ask()
#3 /opt/hg/cli-menu/src/CliMenu.php(459): {closure}()
#4 /opt/hg/cli-menu/src/CliMenu.php(311): PhpSchool\CliMenu\CliMenu->executeCurrentItem()
#5 /opt/hg/cli-menu/src/CliMenu.php(595): PhpSchool\CliMenu\CliMenu->display()
#6 /opt/hg/cli-menu/examples/input-text.php(26): PhpSchool\CliMenu\CliMenu->open()
#7 {main}
  thrown in /opt/hg/cli-menu/src/Input/InputIO.php on line 205

Expected

  • continue working without errors

Copy link
Member

@AydinHassan AydinHassan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks!

@AydinHassan AydinHassan merged commit d2272fc into php-school:master Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants