prompts
prompts copied to clipboard
Change up/down for number to use initial value
This is a small change to make the up/down behaviour a little bit more natural.
Use case:
const {xMovement} = await prompts(
{
type: 'number',
name: 'xMovement',
message: 'How should the asset move horizontally (x)?',
initial: 0
}
);
Repro steps
- Run above example code
- See initial 'grayed out'
0
where value is displayed - Without inputting any new values, press ↑ (up)
Expected result: input value to change in regards to the 0
Actual result: input value is set to -Infinity
New behaviour: pressing ↑ (up) sets the value (cyan) to 0, pressing ↑ (up) again changes the value to 1
Ditto for pressing ↓ (down)