Skip to content

Commit a0e431a

Browse files
committed
refactor: restore default select key
1 parent 37304d8 commit a0e431a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/prompts/src/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,10 @@ export const selectKey = <Value extends string>(opts: SelectOptions<Value>) => {
362362

363363
switch (this.state) {
364364
case 'submit':
365-
value = opt(this.options.find((opt) => opt.value === this.value)!, 'selected');
366-
break;
365+
return `${title}${color.gray(S.BAR)} ${opt(
366+
this.options.find((opt) => opt.value === this.value)!,
367+
'selected'
368+
)}`;
367369
case 'cancel':
368370
return `${title}${color.gray(S_BAR)} ${opt(this.options[0], 'cancelled')}\n${color.gray(
369371
S_BAR

0 commit comments

Comments
 (0)