1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-26 20:39:08 +01:00

Fix bug preventing dropdown close upon outside click (#8145)

The base component we use for dropdowns handles ensuring the dropdown
is closed when the user clicks outside the dropdown. This functionality
was accidentally broken in #7781 when converting it to an ES6 class.
This commit is contained in:
Mark Stacey 2020-03-01 06:13:49 -04:00 committed by GitHub
parent 2b1a22b8b1
commit 887bc078d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -56,7 +56,7 @@ export default class MenuDroppoComponent extends Component {
componentDidMount () {
if (this && document.body) {
document.body.addEventListener('click', this.globalClickHandler)
document.body.addEventListener('click', this.globalClickOccurred)
// eslint-disable-next-line react/no-find-dom-node
const container = findDOMNode(this)
this.container = container
@ -65,7 +65,7 @@ export default class MenuDroppoComponent extends Component {
componentWillUnmount () {
if (this && document.body) {
document.body.removeEventListener('click', this.globalClickHandler)
document.body.removeEventListener('click', this.globalClickOccurred)
}
}