king
2021-08-31 72419e2f826031a158173f46d723a672064e37cd
src/menu/components/share/styleInput/index.jsx
@@ -53,7 +53,7 @@
  }
  UNSAFE_componentWillReceiveProps(nextProps) {
    if (!nextProps.value && this.state.value !== '') {
    if (nextProps.value === '' && this.state.value !== '') {
      this.setState({value: ''})
    } else if (nextProps.value && nextProps.value !== `${this.state.value}${this.state.unit}`) {
      let val = nextProps.value
@@ -76,7 +76,6 @@
      if (isNaN(_val)) {
        _val = ''
      }
      this.setState({value: _val, unit})
    }
  }
@@ -109,7 +108,7 @@
    this.setState({
      value: _val,
    }, () => {
      this.props.onChange(_val ? `${_val}${unit}` : '')
      this.props.onChange(_val !== '' ? `${_val}${unit}` : '')
    })
  }
@@ -117,7 +116,7 @@
    const { value } = this.state
    this.setState({unit: val}, () => {
      this.props.onChange(value ? `${value}${val}` : '')
      this.props.onChange(value !== '' ? `${value}${val}` : '')
    })
  }