aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/editable-label.js
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2016-06-29 04:13:06 +0800
committerkumavis <aaron@kumavis.me>2016-06-29 04:13:06 +0800
commit4777f82ae065bf630c1f1bdc0eb64eacfb4181de (patch)
tree608d036f502353db83d69ad4500fa0d6cf980f97 /ui/app/components/editable-label.js
parent56087543c807e24ff7d3fd2d7b38050ae4bbb598 (diff)
parentd4708828aa780ad3995ef61d6ec8d5130639751b (diff)
downloadtangerine-wallet-browser-4777f82ae065bf630c1f1bdc0eb64eacfb4181de.tar
tangerine-wallet-browser-4777f82ae065bf630c1f1bdc0eb64eacfb4181de.tar.gz
tangerine-wallet-browser-4777f82ae065bf630c1f1bdc0eb64eacfb4181de.tar.bz2
tangerine-wallet-browser-4777f82ae065bf630c1f1bdc0eb64eacfb4181de.tar.lz
tangerine-wallet-browser-4777f82ae065bf630c1f1bdc0eb64eacfb4181de.tar.xz
tangerine-wallet-browser-4777f82ae065bf630c1f1bdc0eb64eacfb4181de.tar.zst
tangerine-wallet-browser-4777f82ae065bf630c1f1bdc0eb64eacfb4181de.zip
Merge branch 'master' into notif2
Diffstat (limited to 'ui/app/components/editable-label.js')
-rw-r--r--ui/app/components/editable-label.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/ui/app/components/editable-label.js b/ui/app/components/editable-label.js
index 3d7ca17d4..05ffd4c92 100644
--- a/ui/app/components/editable-label.js
+++ b/ui/app/components/editable-label.js
@@ -18,6 +18,7 @@ EditableLabel.prototype.render = function () {
return h('div.editable-label', [
h('input.sizing-input', {
defaultValue: props.textValue,
+ maxLength: '30',
onKeyPress: (event) => {
this.saveIfEnter(event)
},
@@ -44,6 +45,7 @@ EditableLabel.prototype.saveIfEnter = function (event) {
EditableLabel.prototype.saveText = function () {
var container = findDOMNode(this)
var text = container.querySelector('.editable-label input').value
- this.props.saveText(text)
- this.setState({ isEditingLabel: false, textLabel: text })
+ var truncatedText = text.substring(0, 30)
+ this.props.saveText(truncatedText)
+ this.setState({ isEditingLabel: false, textLabel: truncatedText })
}