diff --git a/test/e2e/metamask-ui.spec.js b/test/e2e/metamask-ui.spec.js index 52819a7ac..da6d159f6 100644 --- a/test/e2e/metamask-ui.spec.js +++ b/test/e2e/metamask-ui.spec.js @@ -1798,6 +1798,11 @@ describe('MetaMask', function () { By.xpath(`//span[contains(text(), 'http://127.0.0.1:8545/')]`), ) + // click Mainnet to dismiss network dropdown + await driver.clickElement( + By.xpath(`//span[contains(text(), 'Ethereum Mainnet')]`), + ) + assert.equal(customRpcs.length, 2) }) diff --git a/ui/app/components/app/dropdowns/network-dropdown.js b/ui/app/components/app/dropdowns/network-dropdown.js index 613de6b28..4fe270b08 100644 --- a/ui/app/components/app/dropdowns/network-dropdown.js +++ b/ui/app/components/app/dropdowns/network-dropdown.js @@ -255,6 +255,7 @@ class NetworkDropdown extends Component { ) if (notToggleElementIndex === -1) { + event.stopPropagation() this.props.hideNetworkDropdown() } }} diff --git a/ui/app/components/app/menu-droppo.js b/ui/app/components/app/menu-droppo.js index 7fde88988..d9895ec61 100644 --- a/ui/app/components/app/menu-droppo.js +++ b/ui/app/components/app/menu-droppo.js @@ -37,6 +37,7 @@ export default class MenuDroppoComponent extends Component { const container = findDOMNode(this) if ( + this.props.isOpen && target !== container && !isDescendant(this.container, event.target) && this.props.onClickOutside