From 887bc078d716e90293e6fd5edbde08281297790c Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Sun, 1 Mar 2020 06:13:49 -0400 Subject: [PATCH] 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. --- ui/app/components/app/menu-droppo.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/app/components/app/menu-droppo.js b/ui/app/components/app/menu-droppo.js index 1a5d7138c..7ea66927b 100644 --- a/ui/app/components/app/menu-droppo.js +++ b/ui/app/components/app/menu-droppo.js @@ -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) } }