diff --git a/web-console/src/components/auto-form/auto-form.tsx b/web-console/src/components/auto-form/auto-form.tsx index 6a54af721a2..d79e4be4ee7 100644 --- a/web-console/src/components/auto-form/auto-form.tsx +++ b/web-console/src/components/auto-form/auto-form.tsx @@ -173,11 +173,16 @@ export class AutoForm> extends React.Component : undefined; + const modalValue = deepGet(model as any, field.name); return { - const v = e.target.value; - this.fieldChange(field, v === '' ? undefined : (sanitize ? sanitize(v) : v)); + let v = e.target.value; + if (sanitize) v = sanitize(v); + this.fieldChange(field, v); + }} + onBlur={() => { + if (modalValue === '') this.fieldChange(field, undefined); }} placeholder={field.placeholder} rightElement={