fix(xo-web/editable/number): throw error if onChange fails (#5634)

This commit is contained in:
Mathieu 2021-03-03 16:33:41 +01:00 committed by GitHub
parent a630106d80
commit f2d4fdd4d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -11,6 +11,8 @@
> Users must be able to say: “I had this issue, happy to know it's fixed”
- [Editable number] When you are trying to edit a number and it's failing, display an error (PR [#5634](https://github.com/vatesfr/xen-orchestra/pull/5634))
### Packages to release
> Packages will be released in the order they are here, therefore, they should
@ -29,3 +31,4 @@
> In case of conflict, the highest (lowest in previous list) `$version` wins.
- xo-server minor
- xo-web patch

View File

@ -294,7 +294,7 @@ export class Number extends Component {
return +this.refs.input.value
}
_onChange = (value, params) => {
_onChange = async (value, params) => {
if (value === '') {
if (this.props.nullable) {
value = null
@ -305,7 +305,7 @@ export class Number extends Component {
value = +value
}
this.props.onChange(value, params)
await this.props.onChange(value, params)
}
render() {