You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reply on #107 suggests validation works in Form prompts.
Visually, it does - the indicator changes based on whether the input is valid. However, the Form prompt doesn't re-try or throw an error on failed validation, forcing me to again validate and implement re-try manually. What I want is for the user to not be able to submit the form until it's valid.
The text was updated successfully, but these errors were encountered:
Can you provide more details @KernelDeimos? It would be great if you could show a basic example of the form prompt you were trying to get working, with config, choices, etc.
constprompt=newForm({name: 'user',message: 'Please provide the following information:',choices: [{name: 'firstname',message: 'First Name',validate(value){this.error='Invalid name'returnfalse}},]});prompt.run().then(value=>console.log('ANSWERS:',value)).catch(console.error)
I got:
although the validate always returns false, the user can press enter just fine 🤔 Am I missing something?
Reply on #107 suggests validation works in Form prompts.
Visually, it does - the indicator changes based on whether the input is valid. However, the Form prompt doesn't re-try or throw an error on failed validation, forcing me to again validate and implement re-try manually. What I want is for the user to not be able to submit the form until it's valid.
The text was updated successfully, but these errors were encountered: