Skip to content
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

number() input starting value of 10 #75

Open
posen4u opened this issue Apr 16, 2024 · 0 comments
Open

number() input starting value of 10 #75

posen4u opened this issue Apr 16, 2024 · 0 comments

Comments

@posen4u
Copy link

posen4u commented Apr 16, 2024

When prompting for a number I get the behavior that it selects 10 + your first input digit, then adding up the digits after that.

from InquirerPy import inquirer 
from InquirerPy.validator import EmptyInputValidator

number1 = inquirer.number(
    message="Enter a number (1-10000):",
    min_allowed=1,
    max_allowed=10000,
    default=1,
    validate=EmptyInputValidator(),
    vi_mode=False
).execute()

number2 = inquirer.number(
    message="Enter a number (1-10000):",
    min_allowed=1,
    max_allowed=10000,
    default=1,
    validate=EmptyInputValidator(),
    vi_mode=False
).execute()

When being prompted, I press 3 on my keyboard and the prompt will show me 13, and then pressing 1 (for 31) the result ends up being 131. Entering 3 and hitting enter will result in the value 13, entering 7 will result in 17, entering 44 will result in 144 and so on. When removing the input with backspace before hitting enter and trying again it will take my input as expected. But for each first input of a prompt, the above behavior is seen.

What am I missing? vi_mode does not seem to change anything.

Outputs
Input: 130\r32\r:

? Enter a number (1-10000): 1130
? Enter a number (1-10000): 132

Input: 5\b\b5\r5\r

? Enter a number (1-10000): 5
? Enter a number (1-10000): 15

Windows 11
inquirerpy 0.3.4
python 3.12.2

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

No branches or pull requests

1 participant