X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/a1589292a5adde7b41c2fc445c78a52e232fa73a..e9d30481d8d57a0b906364ee115e136305b7ce79:/src/components/text-field/text-field.tsx?ds=sidebyside

diff --git a/src/components/text-field/text-field.tsx b/src/components/text-field/text-field.tsx
index bda1c761..dd864a93 100644
--- a/src/components/text-field/text-field.tsx
+++ b/src/components/text-field/text-field.tsx
@@ -16,7 +16,9 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
     },
 });
 
-export const TextField = withStyles(styles)((props: WrappedFieldProps & WithStyles<CssRules> & { label?: string, autoFocus?: boolean, required?: boolean }) =>
+type TextFieldProps = WrappedFieldProps & WithStyles<CssRules>;
+
+export const TextField = withStyles(styles)((props: TextFieldProps & { label?: string, autoFocus?: boolean, required?: boolean }) =>
     <MaterialTextField
         helperText={props.meta.touched && props.meta.error}
         className={props.classes.textField}
@@ -35,7 +37,7 @@ interface RichEditorTextFieldData {
     label?: string;
 }
 
-type RichEditorTextFieldProps = RichEditorTextFieldData & WrappedFieldProps & WithStyles<CssRules>;
+type RichEditorTextFieldProps = RichEditorTextFieldData & TextFieldProps;
 
 export const RichEditorTextField = withStyles(styles)(
     class RichEditorTextField extends React.Component<RichEditorTextFieldProps> {
@@ -57,19 +59,18 @@ export const RichEditorTextField = withStyles(styles)(
     }
 );
 
-type DataTextFieldProps = WrappedFieldProps & WithStyles<CssRules>;
-
 export const DateTextField = withStyles(styles)
-    ((props: DataTextFieldProps) => 
+    ((props: TextFieldProps) => 
         <MaterialTextField
-            disabled={props.meta.submitting}
-            error={props.meta.touched && !!props.meta.error}
             type="date"
+            disabled={props.meta.submitting}
+            helperText={props.meta.error}
+            error={!!props.meta.error}
             fullWidth={true}
-            name={props.input.name}
             InputLabelProps={{
                 shrink: true
             }}
+            name={props.input.name}
             onChange={props.input.onChange}
             value={props.input.value}
         />    
