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:
parent
2b1a22b8b1
commit
887bc078d7
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user