-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
Default values for string Input prompt are not passed to validators #84
Comments
Thanks for the report. This is a bug and I will fix it. |
Fixed |
@shibayan this doesn't impact only the string Input.
But if you proceed with hitting ENTER the validator says a value is required. |
@jods4 Are the following mappings commonly used? I'm not familiar with it so please let me know if you know.
|
@shibayan For me (y/N) is a good english default for a confirm. |
There are no validators in Confirm. It is required, but can be omitted if a default value is explicitly specified (i.e., it passes by typing the Enter key). So the behavior is correct, it's just that the message displayed is not as common as it should be. |
It doesn't work for us, so I guess it's because the "implicit" default value is not taken into account -- or maybe the default message is just wrong given there's no default? Displaying Are you saying that Confirm shows |
Yes
Yes |
The message display will be corrected in #87. |
If a
defaultValue
is specified in aPrompt.Input<string>
call that also specifies validators, pressing Enter on the prompt sends an empty string to the validators, not the default value. For example:will fail unless providing a non-default value, since an empty string is passed to validators, rather than the default value specified by
defaultValue
.I've created an oversimplified repro in this repo
The text was updated successfully, but these errors were encountered: