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

Content "scrolls up" when typing a new value after validation fails #419

Open
0xmaayan opened this issue Jun 18, 2024 · 0 comments
Open

Comments

@0xmaayan
Copy link

Describe the bug

When the first prompt validation fails, and then typing a different value, the content "scrolls up" on every keyboard press.

To Reproduce

Consider the code

console.log("Hello");
console.log("\World");

const response = await prompts({
    type: 'number',
    name: 'value',
    message: 'How old are you?',
    validate: value => value < 18 ? `Nightclub is 18+ only` : true
  });

Entering an invalid value, will show up the error message, but then when typing a different value the content scrolls up and goes over the content from console.log

Expected behavior

The prompt stays at the same place and doesnt scroll up

System

  • OS: MacOS 10.14.3
  • Terminal: vscode terminal, Warp
  • Node version: v21.6.2

Additional context

Add any other context about the problem here.

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

No branches or pull requests

1 participant