From 8648ee840e942d1e83709ac43daf53c7ab98c92d Mon Sep 17 00:00:00 2001 From: SanariSan <76019273+SanariSan@users.noreply.github.com> Date: Wed, 15 Sep 2021 21:45:58 +0300 Subject: [PATCH] compatibility fix #1042 (#1048) Co-authored-by: SanariSan --- packages/inquirer/lib/prompts/rawlist.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/inquirer/lib/prompts/rawlist.js b/packages/inquirer/lib/prompts/rawlist.js index 959e2e511..06036eafb 100644 --- a/packages/inquirer/lib/prompts/rawlist.js +++ b/packages/inquirer/lib/prompts/rawlist.js @@ -123,7 +123,7 @@ class RawListPrompt extends Base { if (index == null) { index = this.rawDefault; } else if (index === '') { - this.selected = this.selected ?? -1; + this.selected = this.selected === undefined ? -1 : this.selected; index = this.selected; } else { index -= 1;