Commit 8d19a3d2 authored by Yannis Barlas's avatar Yannis Barlas

fix(submission form): stop credit breaking author touched state on blur

parent c28a98a4
......@@ -89,8 +89,6 @@ const AuthorInput = props => {
const autoCompleteProps = omit(props, ['label', 'name', 'value'])
const setTouched = () => setFieldTouched(name, true)
return (
<div>
{label && (
......@@ -119,8 +117,8 @@ const AuthorInput = props => {
<Credit
name={creditName}
readOnly={readOnly}
setFieldTouched={setFieldTouched}
setFieldValue={setFieldValue}
setTouched={setTouched}
touched={touchedThis}
values={get(values, creditName)}
/>
......
......@@ -70,7 +70,14 @@ const StyledSelect = styled(Select)`
`
const Credit = props => {
const { name, readOnly, setTouched, setFieldValue, touched, values } = props
const {
name,
readOnly,
setFieldTouched,
setFieldValue,
touched,
values,
} = props
const currentValues =
values &&
......@@ -82,7 +89,7 @@ const Credit = props => {
}
const handleBlur = e => {
if (!touched) setTouched()
if (!touched) setFieldTouched(name)
}
return (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment