mokkabonna / inquirer-autocomplete-prompt

Autocomplete prompt for inquirer
ISC License
350 stars 82 forks source link

fix: stops the prompt on empty string answer #95

Closed AlexAtHome closed 4 years ago

AlexAtHome commented 4 years ago

If user chooses the empty string as an intentional answer, the autocomplete-questions still goes on and interferes in next questions, which can override next answers.

To reproduce the bug you can clone the bug-reproduce branch in my repo fork, run node example.js and follow the instructions.

Peek 2019-12-25 00-15

karlhorky commented 4 years ago

@mamoruuu This looks pretty good to me!

@mokkabonna you ok with merging this one-liner change and publishing a new version?

-    const dontHaveAnswer = () => !this.answer;
+    const dontHaveAnswer = () => this.answer === undefined;

I admit I haven't been keeping track of all the new things in this repo!

karlhorky commented 4 years ago

@mamoruuu Just merged and published 1.0.2. Sorry for the delay!