| | |
| | | class ColorSketch extends Component { |
| | | static propTpyes = { |
| | | defaultValue: PropTypes.any, |
| | | autoFocus: PropTypes.any, |
| | | config: PropTypes.object, |
| | | onChange: PropTypes.func |
| | | } |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { config } = this.props |
| | | const { config, autoFocus } = this.props |
| | | const { status } = this.state |
| | | return ( |
| | | <Switch checkedChildren={config.openText} autoFocus={true} onBlur={this.props.onBlur} unCheckedChildren={config.closeText} checked={status} onChange={this.changeStatus} /> |
| | | <Switch checkedChildren={config.openText} autoFocus={autoFocus} onBlur={this.props.onBlur} unCheckedChildren={config.closeText} checked={status} onChange={this.changeStatus} /> |
| | | ) |
| | | } |
| | | } |