X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/2cfb56ef5060cbad461062690fad650f15c49731..0a901d62940804d2854b2b39d2ea0199fd795ad3:/src/components/text-field/text-field.tsx

diff --git a/src/components/text-field/text-field.tsx b/src/components/text-field/text-field.tsx
index 13bb1e4f..627e004d 100644
--- a/src/components/text-field/text-field.tsx
+++ b/src/components/text-field/text-field.tsx
@@ -16,17 +16,23 @@ 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, select?: boolean, disabled?: boolean, children: React.ReactNode
+}) =>
     <MaterialTextField
         helperText={props.meta.touched && props.meta.error}
         className={props.classes.textField}
         label={props.label}
-        disabled={props.meta.submitting}
+        disabled={props.disabled || props.meta.submitting}
         error={props.meta.touched && !!props.meta.error}
         autoComplete='off'
         autoFocus={props.autoFocus}
         fullWidth={true}
         required={props.required}
+        select={props.select}
+        children={props.children}
         {...props.input}
     />);
 
@@ -35,7 +41,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> {
@@ -49,7 +55,7 @@ export const RichEditorTextField = withStyles(styles)(
         }
 
         render() {
-            return <RichTextEditor 
+            return <RichTextEditor
                 value={this.state.value}
                 onChange={this.onChange}
                 placeholder={this.props.label} />;
@@ -57,20 +63,19 @@ export const RichEditorTextField = withStyles(styles)(
     }
 );
 
-type DateTextFieldProps = WrappedFieldProps & WithStyles<CssRules>;
-
 export const DateTextField = withStyles(styles)
-    ((props: DateTextFieldProps) => 
+    ((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}
-        />    
+        />
     );
\ No newline at end of file
