fix rating field default value

This commit is contained in:
Michael Schramm 2020-06-10 17:41:19 +02:00
parent 44f1d14d8d
commit e7b5fc50b4
2 changed files with 3 additions and 0 deletions

View File

@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- yes / no field fixed on admin and user view
- prev property error on div
- rating field default on admin
### Security

View File

@ -14,6 +14,8 @@ export const RatingType: React.FC<AdminFieldTypeProps> = (props) => {
name={[props.field.name as string, 'value']}
labelCol={{ span: 6 }}
extra={t('type:rating.clearNote')}
getValueFromEvent={(value: number) => (value !== undefined ? value.toFixed(1) : undefined)}
getValueProps={(value: string) => ({ value: parseFloat(value) })}
>
<Rate allowHalf allowClear />
</Form.Item>