[READ-ONLY] Mirror of https://github.com/bombshell-dev/clack. Effortlessly build beautiful command-line apps bomb.sh/docs/clack/basics/getting-started/
cli command-line command-line-app node prompt prompts
5

Configure Feed

Select the types of activity you want to include in your feed.

fix(#29): do not default value to placeholder

Nate Moore (Feb 17, 2023, 4:39 AM -0600) 7fb53757 362d3188

+7 -4
+6
.changeset/eleven-pumpkins-refuse.md
··· 1 + --- 2 + "@clack/prompts": patch 3 + "@clack/core": patch 4 + --- 5 + 6 + Do not automatically default value to placeholder
-3
packages/core/src/prompts/prompt.ts
··· 153 153 } 154 154 155 155 if (key?.name === 'return') { 156 - if ('placeholder' in this.opts && !this.value) { 157 - this.value = this.opts.placeholder; 158 - } 159 156 if (this.opts.validate) { 160 157 const problem = this.opts.validate(this.value); 161 158 if (problem) {
+1 -1
packages/prompts/src/index.ts
··· 69 69 S_BAR 70 70 )} ${value}\n${color.yellow(S_BAR_END)} ${color.yellow(this.error)}\n`; 71 71 case "submit": 72 - return `${title}${color.gray(S_BAR)} ${color.dim(this.value)}`; 72 + return `${title}${color.gray(S_BAR)} ${color.dim(this.value || opts.placeholder)}`; 73 73 case "cancel": 74 74 return `${title}${color.gray(S_BAR)} ${color.strikethrough( 75 75 color.dim(this.value)