Skip to content

Commit d5c5972

Browse files
authored
fix: fix NumberField optional validation (#1308)
1 parent 0b9fde6 commit d5c5972

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

runner/src/server/plugins/engine/components/NumberField.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,7 @@ export class NumberField extends FormComponent {
4040
}
4141

4242
if (def.options.required === false) {
43-
const optionalSchema = joi
44-
.alternatives()
45-
.try(
46-
joi.string().allow(null).allow("").default("").optional(),
47-
componentSchema
48-
);
43+
const optionalSchema = componentSchema.allow(null).allow("").optional();
4944
this.schema = optionalSchema;
5045
} else {
5146
this.schema = componentSchema;

0 commit comments

Comments
 (0)