1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-30 08:09:15 +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 () { componentDidMount () {
if (this && document.body) { 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 // eslint-disable-next-line react/no-find-dom-node
const container = findDOMNode(this) const container = findDOMNode(this)
this.container = container this.container = container
@ -65,7 +65,7 @@ export default class MenuDroppoComponent extends Component {
componentWillUnmount () { componentWillUnmount () {
if (this && document.body) { if (this && document.body) {
document.body.removeEventListener('click', this.globalClickHandler) document.body.removeEventListener('click', this.globalClickOccurred)
} }
} }