Skip to content

[Bug] [alpha] text(...) placeholder value to aggressive #321

@manuel3108

Description

@manuel3108

Environment

  • OS: DevContainer
  • Node Version: 20.19.1
  • Package: @clack/prompts
  • Package Version: 1.0.0-alpha.0

Describe the bug
Let's assume this code:

const defaultPath = './';
const path = await p.text({
  message: 'Where would you like your project to be created?',
  placeholder: `  (hit Enter to use '${defaultPath}')`,
  defaultValue: defaultPath,
});

console.log(path);

path evaluates to (hit Enter to use './'), but that shouldn't be the case and was not the case in pre 1.0

To Reproduce
Reproduction

Steps to reproduce the behavior:

  1. install deps
  2. run node .
  3. Press "Enter" in the text prompt

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions