Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into fxlemire/mui5
Browse files Browse the repository at this point in the history
  • Loading branch information
cliedeman committed Oct 21, 2021
2 parents 259c1b9 + 04fc871 commit d177c50
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 0 additions & 1 deletion packages/formik-material-ui/src/TextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export function fieldToTextField({
const showError = getIn(touched, field.name) && !!fieldError;

return {
variant: props.variant,
error: showError,
helperText: showError ? fieldError : helperText,
disabled: disabled ?? isSubmitting,
Expand Down
11 changes: 11 additions & 0 deletions stories/TextField.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import Wrapper from './Wrapper';
interface Values {
user: { email: string };
password: string;
helperText: string;
uppercasing: string;
select: string;
outlined: string;
Expand All @@ -27,6 +28,7 @@ const schema = yup.object().shape({
email: yup.string().email().required(),
}),
password: yup.string().required(),
helperText: yup.string().required(),
select: yup.mixed().required(),
});

Expand Down Expand Up @@ -65,6 +67,7 @@ const TextFieldStory = () => (
initialValues={{
user: { email: '' },
password: '',
helperText: '',
uppercasing: '',
select: '',
outlined: '',
Expand Down Expand Up @@ -94,6 +97,14 @@ const TextFieldStory = () => (
name="password"
/>
<br />
<Field
component={TextField}
type="text"
label="Field with helper text"
name="helperText"
helperText="Helper text goes here"
/>
<br />
<Field
component={UpperCasingTextField}
label="Uppercasing"
Expand Down

0 comments on commit d177c50

Please # to comment.