muba-posting 9.0.2 → 9.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muba-posting",
3
- "version": "9.0.2",
3
+ "version": "9.0.3",
4
4
  "description": "Posting",
5
5
  "main": "Posting.js",
6
6
  "scripts": {
@@ -17,23 +17,27 @@ export default class InputNumber extends React.Component {
17
17
 
18
18
  async subtract(value) {
19
19
  if ((this.props.minValue == null || this.props.minValue <= value - 1) && value - 1 >= 0) {
20
- await this.setState({ numberValue: value - 1 })
21
- this.setState({ minValueError: false });
22
-
23
- if (this.props.onChange) {
24
- this.props.onChange(this.state.numberValue);
25
- }
20
+ this.setState({
21
+ numberValue: value - 1,
22
+ minValueError: false
23
+ }, () => {
24
+ if (this.props.onChange) {
25
+ this.props.onChange(this.state.numberValue);
26
+ }
27
+ });
26
28
  }
27
29
  }
28
30
 
29
31
  async add(value) {
30
32
  if (this.props.maxValue == null || this.props.maxValue >= value + 1) {
31
- await this.setState({ numberValue: value + 1 })
32
- this.setState({ minValueError: false });
33
-
34
- if (this.props.onChange) {
35
- this.props.onChange(this.state.numberValue);
36
- }
33
+ this.setState({
34
+ numberValue: value + 1,
35
+ minValueError: false
36
+ }, () => {
37
+ if (this.props.onChange) {
38
+ this.props.onChange(this.state.numberValue);
39
+ }
40
+ });
37
41
  }
38
42
  }
39
43
 
@@ -53,7 +57,7 @@ export default class InputNumber extends React.Component {
53
57
  render() {
54
58
  return (
55
59
  <View style={[commonStyles.col, commonStyles.col6, commonStyles.inputNumberBox]} ref={this.inputNumberView}>
56
- <View style={[commonStyles.col, commonStyles.col12, this.state.minValueError ? commonStyles.fieldError : null]} ref={(element) => this.inputNumberView = element}>
60
+ <View style={[commonStyles.col, commonStyles.col12, this.state.minValueError ? commonStyles.fieldError : null]}>
57
61
  <View style={commonStyles.inputNumberLabelBox}>
58
62
  <View style={commonStyles.row}>
59
63
  <Text style={commonStyles.inputNumberLabel}>{this.props.label}</Text>