On cancel, blur. Only onValueChanged when the value has changed...

This commit is contained in:
Luke Barnard 2017-03-02 18:07:24 +00:00
parent 7a092e4ac7
commit 1d5e47cd70

View File

@ -123,6 +123,7 @@ module.exports = React.createClass({
this.value = this.props.initialValue;
this.showPlaceholder(!this.value);
this.onValueChanged(false);
this.refs.editable_div.blur();
},
onValueChanged: function(shouldSubmit) {
@ -192,7 +193,9 @@ module.exports = React.createClass({
this.setState({
phase: this.Phases.Display,
}, function() {
self.onValueChanged(submit);
if (this.value !== this.props.initialValue) {
self.onValueChanged(submit);
}
});
},