My html code like this :
<div class="chatbot chatbot--closed ">
<div class="chatbot__header">
<p><strong>Got a question?</strong> <span class="u-text-highlight">Ask Harry</span></p>
<svg class="chatbot__close-button icon-speech" viewBox="0 0 32 32">
<use xlink:href="#icon-speech" />
</svg>
<svg class="chatbot__close-button icon-close" viewBox="0 0 32 32">
<use xlink:href="#icon-close" data-toggle="modal" data-target="#basicModal" />
</svg>
</div>
<div class="chatbot__message-window">
<ul class="chatbot__messages">
<li class="is-ai animation">
<div class="is-ai__profile-picture">
<svg class="icon-avatar" viewBox="0 0 32 32">
<use xlink:href="#avatar" />
</svg>
</div>
<span class="chatbot__arrow chatbot__arrow--left"></span>
<p class='chatbot__message'><strong class='intro'>Hello, Iām Harry, your virtual assistant. I'm here to help with your general enquiries.</strong>Example of questions you can ask for demo purpose: <br><em>Hi / How are you? / I'd like some financial advice / Can you email me a statement? / Can I get a form? / How do I cancel my life insurance? </em></p>
</li>
<!-- Message here -->
</ul>
</div>
<div class="chatbot__entry chatbot--closed">
<input type="text" class="chatbot__input" placeholder="Write a message..." />
<svg class="chatbot__submit" viewBox="0 0 32 32">
<use xlink:href="#icon-send" />
</svg>
</div>
</div>
Demo and full code like this : https://codepen.io/trendingnews/pen/wvBorrR?editors=1010
When the user clicks close on the chatbot, it will appear a feedback modal to fill the user experience using chatbot. If the user clicks the close icon on the chatbot, it will close the chatbot. I want the chatbot can closed too when the user clicks the element outside the chatbot
How can I do it?