expose onInput in component, force lowercase for email input
This commit is contained in:
1 parent
8048d8e265
commit
19f666fe82
2 files changed
+6
No files matched your search
@@ -48,6 +48,7 @@ const Field = forwardRef(
|
|||||||
placeholder,
|
placeholder,
|
||||||
value,
|
value,
|
||||||
onChange,
|
onChange,
|
||||||
|
onInput,
|
||||||
error,
|
error,
|
||||||
disabled,
|
disabled,
|
||||||
},
|
},
|
||||||
@@ -87,6 +88,7 @@ const Field = forwardRef(
|
|||||||
multiline={type === "description"}
|
multiline={type === "description"}
|
||||||
rows={type === "description" ? 4 : 1}
|
rows={type === "description" ? 4 : 1}
|
||||||
value={value}
|
value={value}
|
||||||
|
onInput={onInput}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
inputRef={ref}
|
inputRef={ref}
|
||||||
@@ -176,6 +178,8 @@ const Field = forwardRef(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Field.displayName = "Field";
|
||||||
|
|
||||||
Field.propTypes = {
|
Field.propTypes = {
|
||||||
type: PropTypes.oneOf(["text", "password", "url", "email", "description"]),
|
type: PropTypes.oneOf(["text", "password", "url", "email", "description"]),
|
||||||
id: PropTypes.string.isRequired,
|
id: PropTypes.string.isRequired,
|
||||||
@@ -189,6 +193,7 @@ Field.propTypes = {
|
|||||||
placeholder: PropTypes.string,
|
placeholder: PropTypes.string,
|
||||||
value: PropTypes.string.isRequired,
|
value: PropTypes.string.isRequired,
|
||||||
onChange: PropTypes.func,
|
onChange: PropTypes.func,
|
||||||
|
onInput: PropTypes.func,
|
||||||
error: PropTypes.string,
|
error: PropTypes.string,
|
||||||
disabled: PropTypes.bool,
|
disabled: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -226,6 +226,7 @@ const StepTwo = ({ form, errors, onSubmit, onChange, onBack }) => {
|
|||||||
placeholder="jordan.ellis@domain.com"
|
placeholder="jordan.ellis@domain.com"
|
||||||
autoComplete="email"
|
autoComplete="email"
|
||||||
value={form.email}
|
value={form.email}
|
||||||
|
onInput={(e) => (e.target.value = e.target.value.toLowerCase())}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
error={errors.email}
|
error={errors.email}
|
||||||
ref={inputRef}
|
ref={inputRef}
|
||||||
|
|||||||
Reference in new issue
Block a user