Closes the popover when the user clicks outside the popover