8000 Content "scrolls up" when typing a new value after validation fails · Issue #419 · terkelg/prompts · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Content "scrolls up" when typing a new value after validation fails #419
Open
@0xmaayan

Description

@0xmaayan

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0