Skip to content

Commit

Permalink
fix(overflow-menu): check if function exists before calling
Browse files Browse the repository at this point in the history
  • Loading branch information
tw15egan committed Aug 21, 2020
1 parent 1fbca23 commit 172a4fe
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions packages/react/src/components/OverflowMenu/OverflowMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,14 +405,16 @@ class OverflowMenu extends Component {
(event) => {
const { target } = event;
const { current: triggerEl } = this._triggerRef;
if (
!menuBody.contains(target) &&
triggerEl &&
!target.matches(
`.${prefix}--overflow-menu,.${prefix}--overflow-menu-options`
)
) {
this.closeMenu();
if (target.matches) {
if (
!menuBody.contains(target) &&
triggerEl &&
!target.matches(
`.${prefix}--overflow-menu,.${prefix}--overflow-menu-options`
)
) {
this.closeMenu();
}
}
},
!hasFocusin
Expand Down

0 comments on commit 172a4fe

Please sign in to comment.