aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorsdtsui <szehungdanieltsui@gmail.com>2017-07-29 06:31:03 +0800
committersdtsui <szehungdanieltsui@gmail.com>2017-07-29 06:31:07 +0800
commit24d375aaf1717f1ae743fbe6e83eb50f0e6a4b95 (patch)
tree9fa779df17031a8fc0cf8eecf68addc986a551f2 /ui
parent651fec5112ee77eed995db80621d2ae6e799e8cf (diff)
downloadtangerine-wallet-browser-24d375aaf1717f1ae743fbe6e83eb50f0e6a4b95.tar
tangerine-wallet-browser-24d375aaf1717f1ae743fbe6e83eb50f0e6a4b95.tar.gz
tangerine-wallet-browser-24d375aaf1717f1ae743fbe6e83eb50f0e6a4b95.tar.bz2
tangerine-wallet-browser-24d375aaf1717f1ae743fbe6e83eb50f0e6a4b95.tar.lz
tangerine-wallet-browser-24d375aaf1717f1ae743fbe6e83eb50f0e6a4b95.tar.xz
tangerine-wallet-browser-24d375aaf1717f1ae743fbe6e83eb50f0e6a4b95.tar.zst
tangerine-wallet-browser-24d375aaf1717f1ae743fbe6e83eb50f0e6a4b95.zip
Fix dropdown toggle behavior - account dropdowns
Diffstat (limited to 'ui')
-rw-r--r--ui/app/components/account-dropdowns.js18
1 files changed, 16 insertions, 2 deletions
diff --git a/ui/app/components/account-dropdowns.js b/ui/app/components/account-dropdowns.js
index 61f32f713..2813f4752 100644
--- a/ui/app/components/account-dropdowns.js
+++ b/ui/app/components/account-dropdowns.js
@@ -17,6 +17,8 @@ class AccountDropdowns extends Component {
accountSelectorActive: false,
optionsMenuActive: false,
}
+ this.accountSelectorToggleClassName = 'fa-angle-down';
+ this.optionsMenuToggleClassName = 'fa-ellipsis-h';
}
renderAccounts () {
@@ -63,7 +65,13 @@ class AccountDropdowns extends Component {
maxHeight: '300px',
},
isOpen: accountSelectorActive,
- onClickOutside: () => { this.setState({ accountSelectorActive: false }) },
+ onClickOutside: (event) => {
+ const { classList } = event.target
+ const isNotToggleElement = !classList.contains(this.accountSelectorToggleClassName)
+ if (accountSelectorActive && isNotToggleElement) {
+ this.setState({ accountSelectorActive: false })
+ }
+ },
},
[
...this.renderAccounts(),
@@ -115,7 +123,13 @@ class AccountDropdowns extends Component {
minWidth: '180px',
},
isOpen: optionsMenuActive,
- onClickOutside: () => { this.setState({ optionsMenuActive: false }) },
+ onClickOutside: () => {
+ const { classList } = event.target
+ const isNotToggleElement = !classList.contains(this.optionsMenuToggleClassName)
+ if (optionsMenuActive && isNotToggleElement) {
+ this.setState({ optionsMenuActive: false })
+ }
+ },
},
[
h(