fix(textInput): Allow empty strings for a value (#11182)

fix: allow empty strings

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
Jiralite
2025-10-16 14:55:15 +01:00
committed by GitHub
parent d03eb5e26e
commit 0cc92bd5b0
2 changed files with 5 additions and 1 deletions

View File

@@ -11,6 +11,10 @@ describe('Text Input Components', () => {
textInputComponent().setCustomId('foobar').setStyle(TextInputStyle.Paragraph).toJSON();
}).not.toThrowError();
expect(() => {
textInputComponent().setCustomId('foobar').setValue('').setStyle(TextInputStyle.Paragraph).toJSON();
}).not.toThrowError();
expect(() => {
textInputComponent()
.setCustomId('foobar')

View File

@@ -10,6 +10,6 @@ export const textInputPredicate = z.object({
min_length: z.number().min(0).max(4_000).optional(),
max_length: z.number().min(1).max(4_000).optional(),
placeholder: z.string().max(100).optional(),
value: z.string().min(1).max(4_000).optional(),
value: z.string().min(0).max(4_000).optional(),
required: z.boolean().optional(),
});