mirror of https://github.com/apache/druid.git
less aggressive default value (#7844)
This commit is contained in:
parent
ee0d4ea589
commit
0ca867efbf
|
@ -173,11 +173,16 @@ export class AutoForm<T extends Record<string, any>> extends React.Component<Aut
|
|||
</Menu> :
|
||||
undefined;
|
||||
|
||||
const modalValue = deepGet(model as any, field.name);
|
||||
return <InputGroup
|
||||
value={deepGet(model as any, field.name) || field.defaultValue || ''}
|
||||
value={modalValue != null ? modalValue : (field.defaultValue || '')}
|
||||
onChange={(e: any) => {
|
||||
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={
|
||||
|
|
Loading…
Reference in New Issue