-
Notifications
You must be signed in to change notification settings - Fork 176
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Environment
- OS: Windows
- Node Version: v18.17.1
- Package: @clack/prompts
- Package Version: v0.7.0]
Describe the bug
After updating to the latest version, prompt behavior has changed after awaiting spinner. The await line between spinner start and stop is causing issues with the second following prompt, where it does not respond to any key input (like arrow keys or even Ctrl-C), only the [Enter] key, which then "activates" the normal behavior, but creates a duplicate of the first option.
With the await line commented out, everything works as expected.
The prompt order does not matter, the second one is always effected.
│
◇ Test anyway?
│ Yes
│
◆ test
│ ◻ A (hint A)
│ ◻ A
│ ◻ B (hint B)
│ ◻ C
└
◇ test
│ B
│
◆ Test anyway?
│ ● Yes / ○ No
│ ○ Yes / ● No
To Reproduce
Steps to reproduce the behavior:
- Using the following code:
const sp = p.spinner();
sp.start("start");
await setTimeout(2000);
sp.stop("stop");
const y = await p.confirm({
message: "Test anyway?",
});
const x = await p.multiselect({
message: "test",
options: [
{ value: "a", label: "A", hint: "hint A" },
{ value: "b", label: "B", hint: "hint B" },
{ value: "c", label: "C", hint: "hint C" },
],
required: false,
});Expected behavior
To be able to navigate from prompt to prompt using the keyboard, and use Ctrl-C to quit.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working