Close automatically when clicked outside