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> :
|
</Menu> :
|
||||||
undefined;
|
undefined;
|
||||||
|
|
||||||
|
const modalValue = deepGet(model as any, field.name);
|
||||||
return <InputGroup
|
return <InputGroup
|
||||||
value={deepGet(model as any, field.name) || field.defaultValue || ''}
|
value={modalValue != null ? modalValue : (field.defaultValue || '')}
|
||||||
onChange={(e: any) => {
|
onChange={(e: any) => {
|
||||||
const v = e.target.value;
|
let v = e.target.value;
|
||||||
this.fieldChange(field, v === '' ? undefined : (sanitize ? sanitize(v) : v));
|
if (sanitize) v = sanitize(v);
|
||||||
|
this.fieldChange(field, v);
|
||||||
|
}}
|
||||||
|
onBlur={() => {
|
||||||
|
if (modalValue === '') this.fieldChange(field, undefined);
|
||||||
}}
|
}}
|
||||||
placeholder={field.placeholder}
|
placeholder={field.placeholder}
|
||||||
rightElement={
|
rightElement={
|
||||||
|
|
Loading…
Reference in New Issue