Avoid conflicts between click and tap by asynchronously listening for a tap event to close the overlay.