From dc1483cc638c805d30add811ee456dd288b43f06 Mon Sep 17 00:00:00 2001 From: pedrofcarvalho Date: Tue, 9 Sep 2025 17:17:14 -0700 Subject: [PATCH] feat: Fix validate function for text when value is empty with default value --- packages/core/src/prompts/text.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/core/src/prompts/text.ts b/packages/core/src/prompts/text.ts index c76a5188..a4dee8b4 100644 --- a/packages/core/src/prompts/text.ts +++ b/packages/core/src/prompts/text.ts @@ -39,5 +39,10 @@ export default class TextPrompt extends Prompt { this.value = ''; } }); + this.on('key', () => { + if (!this.value) { + this.value = opts.defaultValue; + } + }); } }