Skip to content

Commit

Permalink
Add truthy check for the Popover component onClose prop before callin…
Browse files Browse the repository at this point in the history
…g it. (WordPress#17100)
  • Loading branch information
aprea authored and talldan committed Aug 20, 2019
1 parent dc659b5 commit 2cd5dc3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/components/src/popover/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,9 @@ const Popover = ( {
onFocusOutside( event );
return;
} else if ( ! onClickOutside ) {
onClose();
if ( onClose ) {
onClose();
}
return;
}

Expand Down

0 comments on commit 2cd5dc3

Please sign in to comment.