Basically, when you click on the lens icon, it shows a hidden search bar, and if you click again on the lens, it hides it back. How can I achieve the same result, (hiding it) by clicking on the body, hence anywhere outside the icon itself?
Hope it was clear, thanks in advance.
P.S. To add the transition, I added the class “active” to the div, and through JS I simply toggle it with a click event.