From 4044b58b5a7133caeefd0f3c0a16478387fe7247 Mon Sep 17 00:00:00 2001 From: sdtsui Date: Fri, 28 Jul 2017 15:55:55 -0700 Subject: Fix dropdown behavior - network --- ui/app/app.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'ui') diff --git a/ui/app/app.js b/ui/app/app.js index f293e89bd..8fad0f7d6 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -198,7 +198,17 @@ App.prototype.renderNetworkDropdown = function () { return h(Dropdown, { isOpen, onClickOutside: (event) => { - this.setState({ isNetworkMenuOpen: !isOpen }) + const { classList } = event.target + const isNotToggleElement = [ + classList.contains('menu-icon'), + classList.contains('network-name'), + classList.contains('network-indicator'), + ].filter(bool => bool).length === 0; + // classes from three constituent nodes of the toggle element + + if (isNotToggleElement) { + this.setState({ isNetworkMenuOpen: false }) + } }, zIndex: 11, style: { -- cgit v1.2.3