Added ability to delete color value.

This commit is contained in:
orangemug 2019-06-19 20:44:27 +01:00
parent 2ec6a90dc3
commit ceeb628784

View file

@ -57,6 +57,10 @@ class ColorField extends React.Component {
} }
} }
onChange (v) {
this.props.onChange(v === "" ? undefined : v);
}
render() { render() {
const offset = this.calcPickerOffset() const offset = this.calcPickerOffset()
var currentColor = this.color.object() var currentColor = this.color.object()
@ -110,7 +114,7 @@ class ColorField extends React.Component {
name={this.props.name} name={this.props.name}
placeholder={this.props.default} placeholder={this.props.default}
value={this.props.value ? this.props.value : ""} value={this.props.value ? this.props.value : ""}
onChange={(e) => this.props.onChange(e.target.value)} onChange={(e) => this.onChange(e.target.value)}
/> />
</div> </div>
} }