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

pull/21833/head
Luke Barnard 2017-03-02 18:07:24 +00:00
parent 7a092e4ac7
commit 1d5e47cd70
1 changed files with 4 additions and 1 deletions

View File

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