Skip to content

Commit

Permalink
fix(OverflowMenu): call closeMenu method only when menu is open (#5336)
Browse files Browse the repository at this point in the history
  • Loading branch information
emyarod authored Feb 17, 2020
1 parent 7e4c0e5 commit 61d1373
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/react/src/components/OverflowMenu/OverflowMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,10 @@ class OverflowMenu extends Component {
};

handleClickOutside = evt => {
if (!this._menuBody || !this._menuBody.contains(evt.target)) {
if (
this.state.open &&
(!this._menuBody || !this._menuBody.contains(evt.target))
) {
this.closeMenu();
}
};
Expand Down

0 comments on commit 61d1373

Please sign in to comment.