From 1d5e47cd703d1c152701746ae622ecb674e57391 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Thu, 2 Mar 2017 18:07:24 +0000 Subject: [PATCH] On cancel, blur. Only onValueChanged when the value has changed... --- src/components/views/elements/EditableText.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/views/elements/EditableText.js b/src/components/views/elements/EditableText.js index 1e67e4fb1e..3ce8c90447 100644 --- a/src/components/views/elements/EditableText.js +++ b/src/components/views/elements/EditableText.js @@ -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); + } }); },