aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-05-31 22:53:12 +0800
committerDan <danjm.com@gmail.com>2018-06-01 00:17:18 +0800
commit990b69c6552b5571391ea5fbf05b5fbef1e0ab10 (patch)
treef6f36de5add340391edece50f92ceba6fb75ece0
parent704ba54bef4d7b29b265ce0d3a6b2e4b2c7a36eb (diff)
downloadtangerine-wallet-browser-990b69c6552b5571391ea5fbf05b5fbef1e0ab10.tar
tangerine-wallet-browser-990b69c6552b5571391ea5fbf05b5fbef1e0ab10.tar.gz
tangerine-wallet-browser-990b69c6552b5571391ea5fbf05b5fbef1e0ab10.tar.bz2
tangerine-wallet-browser-990b69c6552b5571391ea5fbf05b5fbef1e0ab10.tar.lz
tangerine-wallet-browser-990b69c6552b5571391ea5fbf05b5fbef1e0ab10.tar.xz
tangerine-wallet-browser-990b69c6552b5571391ea5fbf05b5fbef1e0ab10.tar.zst
tangerine-wallet-browser-990b69c6552b5571391ea5fbf05b5fbef1e0ab10.zip
Improve input width calculation in currency-display.js
-rw-r--r--ui/app/components/send/currency-display.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/ui/app/components/send/currency-display.js b/ui/app/components/send/currency-display.js
index ff61bd1e7..360dd15d4 100644
--- a/ui/app/components/send/currency-display.js
+++ b/ui/app/components/send/currency-display.js
@@ -98,9 +98,8 @@ CurrencyDisplay.prototype.handleChange = function (newVal) {
CurrencyDisplay.prototype.getInputWidth = function (valueToRender, readOnly) {
const valueString = String(valueToRender)
const valueLength = valueString.length || 1
- const dynamicBuffer = readOnly ? 0 : 1
- const decimalPointDeficit = !readOnly && valueString.match(/\./) ? -0.5 : 0
- return (valueLength + dynamicBuffer + decimalPointDeficit) + 'ch'
+ const decimalPointDeficit = valueString.match(/\./) ? -0.5 : 0
+ return (valueLength + decimalPointDeficit + 0.75) + 'ch'
}
CurrencyDisplay.prototype.render = function () {