Fix DataEntry errors

This commit is contained in:
Maciej Ziarkowski 2019-10-17 16:15:28 +01:00
parent e1e1bc7aa5
commit 0e1aca0e9e
2 changed files with 11 additions and 3 deletions

View File

@ -37,9 +37,12 @@ const DataEntry: React.FunctionComponent<DataEntryProps> = (props) => {
disabled={props.mode === 'view' || props.disabled}
placeholder={props.placeholder}
onChange={e =>
e.target.value === '' ?
null :
props.onChange(props.slug, e.target.value)
props.onChange(
props.slug,
e.target.value === '' ?
null :
e.target.value
)
}
/>
</Fragment>

View File

@ -42,7 +42,12 @@ const TypeView = (props) => {
/>
<DataEntry
title="Original building use"
slug=""
tooltip="What was the building originally used for when it was built? I.e. If it was Victorian warehouse which is now an office this would be warehouse"
value={undefined}
copy={props.copy}
mode={props.mode}
onChange={props.onUpdate}
disabled={true}
/>
</Fragment>