mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
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:
@@ -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')
|
||||
|
||||
@@ -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(),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user