aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2016-06-29 04:02:34 +0800
committerGitHub <noreply@github.com>2016-06-29 04:02:34 +0800
commit2fd03a60fb8c536dbe56c86e1836935616ea14d8 (patch)
treeb28c6b501c4b44e4340832b61a9d8725e4faabf9 /ui/app
parent7026eca222283ea873fd576c4cae5ba0ab5ad129 (diff)
parentabcf7621847220f0709eb37cca0fd93cd0632bd5 (diff)
downloadtangerine-wallet-browser-2fd03a60fb8c536dbe56c86e1836935616ea14d8.tar
tangerine-wallet-browser-2fd03a60fb8c536dbe56c86e1836935616ea14d8.tar.gz
tangerine-wallet-browser-2fd03a60fb8c536dbe56c86e1836935616ea14d8.tar.bz2
tangerine-wallet-browser-2fd03a60fb8c536dbe56c86e1836935616ea14d8.tar.lz
tangerine-wallet-browser-2fd03a60fb8c536dbe56c86e1836935616ea14d8.tar.xz
tangerine-wallet-browser-2fd03a60fb8c536dbe56c86e1836935616ea14d8.tar.zst
tangerine-wallet-browser-2fd03a60fb8c536dbe56c86e1836935616ea14d8.zip
Merge pull request #344 from Zanibas/character-limit
Character limit implemented for wallet names
Diffstat (limited to 'ui/app')
-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 })
}