I have an async validation that takes a while. When the user presses enter, nothing seems to happen, until the validation completes. Is it possible to add some visual indication (for example, changing the question mark into a progress spinner), while the validation is running. The UI feels unresponsive now.
Unfortunately, I can't console.log something like that myself, because if the validation fails, any logging will cause the question to repeat, which is not what I want.
This would be a great improvement I believe.
Anyone wants to work on a PR?
With some guidance, I might. It seems that functionality would wrap this call: https://github.com/SBoudrias/Inquirer.js/blob/master/lib/prompts/base.js#L87 with something like startSpinner -> call validate -> resetSpinner. Would that be the right place to put this?
This is the implementation I have now. I added another option validatingText to a question for it too.

This can also be extended to filtering, which is also async:

In the filtering case, I also added updating the display with the filtered answer after filtering is complete.
@SBoudrias Please see my PR for implementation details.
any update on this @kbrandwijk @SBoudrias ? I would love to have this!
The PR apparently needs something (test case?) but I don't have any time to do it...
bummer :(
@benmonro Feel free to contribute if you'd like to 'have this'...
Check out the ora module by Sindre Sorhus.
Most helpful comment
@SBoudrias Please see my PR for implementation details.