This is an automated email from the ASF dual-hosted git repository.
fjy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-druid.git
The following commit(s) were added to refs/heads/master by this push:
new 0ca867e less aggressive default value (#7844)
0ca867e is described below
commit 0ca867efbffe4903d0444950eadd5224e8858b0f
Author: Vadim Ogievetsky <[email protected]>
AuthorDate: Fri Jun 7 08:31:21 2019 -0700
less aggressive default value (#7844)
---
web-console/src/components/auto-form/auto-form.tsx | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/web-console/src/components/auto-form/auto-form.tsx
b/web-console/src/components/auto-form/auto-form.tsx
index 6a54af7..d79e4be 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<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={
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]