diff --git a/packages/core/src/prompts/select-key.ts b/packages/core/src/prompts/select-key.ts index 1de8d0d..b9b1a2b 100644 --- a/packages/core/src/prompts/select-key.ts +++ b/packages/core/src/prompts/select-key.ts @@ -11,12 +11,12 @@ export default class SelectKeyPrompt extends Prompt { super(opts, false); this.options = opts.options; - const keys = this.options.map(({ value: [initial] }) => initial); + const keys = this.options.map(({ value: [initial] }) => initial?.toLowerCase()); this.cursor = Math.max(keys.indexOf(opts.initialValue), 0); this.on('key', (key) => { if (!keys.includes(key)) return; - const value = this.options.find(({ value: [initial] }) => initial === key); + const value = this.options.find(({ value: [initial] }) => initial?.toLowerCase() === key); if (value) { this.value = value.value; this.state = 'submit';