king
2023-02-03 1ba430d58ea3fd662d09b99f6e22ed3b3564a356
src/menu/stylecontroller/styleInput/index.jsx
@@ -48,6 +48,8 @@
        unit = 'vw'
      } else if (val.indexOf('vh') > -1) {
        unit = 'vh'
      } else if (val === 'auto' && _options.includes('auto')) {
        unit = 'auto'
      }
    }
@@ -135,8 +137,14 @@
    const { value } = this.state
    this.setState({unit: val})
    if (value && this.props.onChange) {
      this.props.onChange(`${value}${val}`)
    if (val === 'auto') {
      this.setState({value: ''})
      this.props.onChange('auto')
    } else {
      if (value && this.props.onChange) {
        this.props.onChange(`${value}${val}`)
      }
    }
  }
@@ -145,7 +153,7 @@
    return (
      <div className="style-input-box">
        <Input value={value} addonAfter={
        <Input value={value} disabled={unit === 'auto'} addonAfter={
          options.length > 1 ?
          <Select value={unit} onChange={this.changeUnit}>
            {options.map(item => <Option key={item} value={item}>{item}</Option>)}