summaryrefslogtreecommitdiffhomepage
path: root/app/components
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@codeispoetry.ru>2017-03-08 16:57:43 +0000
committerAndrej Mihajlov <and@codeispoetry.ru>2017-03-08 16:57:43 +0000
commitefece094f569bc8c851add644e98415d07fd5e3d (patch)
tree9e8834a23878b5a16679f9e6274441058f912933 /app/components
parenta4aa1cec332fa8903dd66582a0ff1df903343450 (diff)
downloadmullvadvpn-efece094f569bc8c851add644e98415d07fd5e3d.tar.xz
mullvadvpn-efece094f569bc8c851add644e98415d07fd5e3d.zip
Avoid saving ref
Diffstat (limited to 'app/components')
-rw-r--r--app/components/AccountInput.js17
1 files changed, 8 insertions, 9 deletions
diff --git a/app/components/AccountInput.js b/app/components/AccountInput.js
index 56097f5e74..0f72c02d17 100644
--- a/app/components/AccountInput.js
+++ b/app/components/AccountInput.js
@@ -128,7 +128,7 @@ export default class AccountInput extends Component {
}
onSelect(e) {
- const ref = this._input;
+ const ref = e.target;
let start = ref.selectionStart;
let end = ref.selectionEnd;
@@ -149,14 +149,13 @@ export default class AccountInput extends Component {
}
onRef(ref) {
- this._input = ref;
- if(ref) {
- const { value, selectionRange } = this.state;
- const domRange = this.toDomSelection(value, selectionRange);
- // if(ref.selectionStart !== domRange[0] || ref.selectionEnd !== domRange[1]) {
- ref.setSelectionRange(domRange[0], domRange[1]);
- // }
- }
+
+ const { value, selectionRange } = this.state;
+ const domRange = this.toDomSelection(value, selectionRange);
+ // if(ref.selectionStart !== domRange[0] || ref.selectionEnd !== domRange[1]) {
+ ref && ref.setSelectionRange(domRange[0], domRange[1]);
+ // }
+
}
render() {