Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change up/down for number to use initial value #367

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jackcannon
Copy link

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

  1. Run above example code
  2. See initial 'grayed out' 0 where value is displayed
  3. 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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant