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
When a prompt has an async when which returns false after some time, the next prompt will not start registering input until the enter key is pressed, and the question is duplicated.
If the async when resolves immediately, or within a single tick (e.g. setTimeout with 1ms) then the issue does not occur.
If when is set to false directly, the issue also does not occur.
Reproduced on both the latest version 8.2.0 and the much older 6.5.0.
Here's an example:
And the code used:
constinquirer=require('inquirer');(asyncfunction(){awaitinquirer.prompt({name: 'cancelled',type: 'input',message: 'Enter some text (hidden)',when: async()=>{// Set this timeout to 0, 1 or remove it and the issue goes away??awaitnewPromise(r=>setTimeout(r,50));returnfalse}});console.log(awaitinquirer.prompt({name: 'input1',type: 'input',message: 'Enter some text (#1)'}));console.log(awaitinquirer.prompt({name: 'input2',type: 'input',message: 'Enter some text (#2)'}));})();
The text was updated successfully, but these errors were encountered:
Platforms: Windows 10, 11
Node versions: 14, 16
When a prompt has an async
when
which returns false after some time, the next prompt will not start registering input until the enter key is pressed, and the question is duplicated.when
resolves immediately, or within a single tick (e.g. setTimeout with 1ms) then the issue does not occur.when
is set to false directly, the issue also does not occur.Reproduced on both the latest version
8.2.0
and the much older6.5.0
.Here's an example:
And the code used:
The text was updated successfully, but these errors were encountered: