You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using an autocompleteMultiselect prompt, pressing space to select when there's no results for a filter causes a crash.
To Reproduce
Run this code:
importpromptsfrom'prompts';awaitprompts({type: 'autocompleteMultiselect',name: 'test',message: 'Enter some gibberish below, then press space',choices: [{title: 'Foo',value: 'Foo',},],});
Type some random text so no results match the filter
Press space to "select" this option
Error:
node:internal/readline/emitKeypressEvents:74
throw err;
^
TypeError: Cannot read properties of undefined (reading 'selected')
at AutocompleteMultiselectPrompt.handleSpaceToggle (/Users/albert/Documents/repo/node_modules/prompts/lib/elements/autocompleteMultiselect.js:101:11)
at AutocompleteMultiselectPrompt._ (/Users/albert/Documents/repo/node_modules/prompts/lib/elements/autocompleteMultiselect.js:119:12)
at ReadStream.keypress (/Users/albert/Documents/repo/node_modules/prompts/lib/elements/prompt.js:30:24)
at ReadStream.emit (node:events:518:28)
at emitKeys (node:internal/readline/utils:371:14)
at emitKeys.next (<anonymous>)
at ReadStream.onData (node:internal/readline/emitKeypressEvents:64:36)
at ReadStream.emit (node:events:530:35)
at addChunk (node:internal/streams/readable:559:12)
at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
Node.js v20.12.2
Expected behavior
Likely should do nothing, but definitely shouldn't be erroring
System
OS: macOS Sonoma 14.5
Terminal: iTerm 3.5.0
Node version: v20.12.2
Additional context
N/A
The text was updated successfully, but these errors were encountered:
Describe the bug
When using an
autocompleteMultiselect
prompt, pressing space to select when there's no results for a filter causes a crash.To Reproduce
Run this code:
Expected behavior
Likely should do nothing, but definitely shouldn't be erroring
System
Additional context
N/A
The text was updated successfully, but these errors were encountered: