Skip to content

Commit

Permalink
compatibility fix #1042
Browse files Browse the repository at this point in the history
  • Loading branch information
SanariSan committed Sep 15, 2021
1 parent 47dfcaf commit e97d4fe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/inquirer/lib/prompts/rawlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ class RawListPrompt extends Base {
if (index == null) {
index = this.rawDefault;
} else if (index === '') {
this.selected = this.selected ?? -1;
this.selected =
this.selected !== null && this.selected !== undefined ? this.selected : -1;
index = this.selected;
} else {
index -= 1;
Expand Down

0 comments on commit e97d4fe

Please sign in to comment.