Skip to content

Commit

Permalink
fix(overflow-menu): check if function exists before calling (#6707)
Browse files Browse the repository at this point in the history
  • Loading branch information
tw15egan authored Aug 24, 2020
1 parent 1fbca23 commit 019b5e7
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 (typeof target.matches === 'function') {
if (
!menuBody.contains(target) &&
triggerEl &&
!target.matches(
`.${prefix}--overflow-menu,.${prefix}--overflow-menu-options`
)
) {
this.closeMenu();
}
}
},
!hasFocusin
Expand Down

0 comments on commit 019b5e7

Please sign in to comment.