aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/send
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2017-10-11 08:45:31 +0800
committerChi Kei Chan <chikeichan@gmail.com>2017-10-13 02:09:05 +0800
commit2898914a544c4f934cdbe592b7b44df4d08127c8 (patch)
tree717271bcd886cfeead3ed2e17eff73aa721a851c /ui/app/components/send
parentea7926c211965e2e529e5795a4e1655e97e32144 (diff)
downloadtangerine-wallet-browser-2898914a544c4f934cdbe592b7b44df4d08127c8.tar
tangerine-wallet-browser-2898914a544c4f934cdbe592b7b44df4d08127c8.tar.gz
tangerine-wallet-browser-2898914a544c4f934cdbe592b7b44df4d08127c8.tar.bz2
tangerine-wallet-browser-2898914a544c4f934cdbe592b7b44df4d08127c8.tar.lz
tangerine-wallet-browser-2898914a544c4f934cdbe592b7b44df4d08127c8.tar.xz
tangerine-wallet-browser-2898914a544c4f934cdbe592b7b44df4d08127c8.tar.zst
tangerine-wallet-browser-2898914a544c4f934cdbe592b7b44df4d08127c8.zip
Send v2 amount unit moves correctly.
Diffstat (limited to 'ui/app/components/send')
-rw-r--r--ui/app/components/send/currency-display.js20
1 files changed, 19 insertions, 1 deletions
diff --git a/ui/app/components/send/currency-display.js b/ui/app/components/send/currency-display.js
index e0147012f..2ffddb178 100644
--- a/ui/app/components/send/currency-display.js
+++ b/ui/app/components/send/currency-display.js
@@ -13,6 +13,7 @@ function CurrencyDisplay () {
this.state = {
minWidth: null,
+ currentScrollWidth: null,
}
}
@@ -22,7 +23,24 @@ function isValidNumber (text) {
}
CurrencyDisplay.prototype.componentDidMount = function () {
- this.setState({ minWidth: this.refs.currencyDisplayInput.sizer.scrollWidth + 10 })
+ this.setState({
+ minWidth: this.refs.currencyDisplayInput.sizer.clientWidth + 10,
+ currentclientWidth: this.refs.currencyDisplayInput.sizer.clientWidth,
+ })
+}
+
+CurrencyDisplay.prototype.componentWillUpdate = function ({ value: nextValue }) {
+ const { value: currentValue } = this.props
+ const { currentclientWidth } = this.state
+ const newclientWidth = this.refs.currencyDisplayInput.sizer.clientWidth
+
+ if (currentclientWidth !== newclientWidth) {
+ const clientWidthChange = newclientWidth - currentclientWidth
+ this.setState({
+ minWidth: this.state.minWidth + clientWidthChange,
+ currentclientWidth: newclientWidth,
+ })
+ }
}
CurrencyDisplay.prototype.render = function () {