fix(alpha): number field with hasMany accept defaultValue array (#5619)

This commit is contained in:
Jessica Chowdhury
2024-04-03 13:05:49 +01:00
committed by GitHub
parent 777a661389
commit 4ee4ad25b0

View File

@@ -112,7 +112,13 @@ export const number = baseField.keys({
placeholder: joi.string(),
step: joi.number(),
}),
defaultValue: joi.alternatives().try(joi.number(), joi.func()),
defaultValue: joi
.alternatives()
.try(
joi.number(),
joi.func(),
joi.array().when('hasMany', { not: true, then: joi.forbidden() }),
),
hasMany: joi.boolean().default(false),
max: joi.number(),
maxRows: joi.number().when('hasMany', { is: joi.not(true), then: joi.forbidden() }),