Add file-upload focus indicator, add submit type for dialog default button
[arvados-workbench2.git] / src / components / text-field / text-field.tsx
index 1fe77ca66c6de47c4516352cc54d9dfcfa4e659e..b5671dbb08c962b8bae3458738fdf634b57bc382 100644 (file)
@@ -15,7 +15,7 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
     },
 });
 
-export const TextField = withStyles(styles)((props: WrappedFieldProps & WithStyles<CssRules> & { label?: string }) =>
+export const TextField = withStyles(styles)((props: WrappedFieldProps & WithStyles<CssRules> & { label?: string, autoFocus?: boolean }) =>
     <MaterialTextField
         helperText={props.meta.touched && props.meta.error}
         className={props.classes.textField}
@@ -23,6 +23,7 @@ export const TextField = withStyles(styles)((props: WrappedFieldProps & WithStyl
         disabled={props.meta.submitting}
         error={props.meta.touched && !!props.meta.error}
         autoComplete='off'
+        autoFocus={props.autoFocus}
         fullWidth={true}
         {...props.input}
     />);