$(document).on('click touchstart', function (e) {
if (!$(e.target).is(".search-icon *")) {
$('.search-input').removeClass('active');
};
});
let f = function(e){
if(e.target.parentNode && e.target.parentNode.classList && e.target.parentNode.classList.contains("search-icon"))
document.querySelector(".search-input").classList.remove("active");
}
document.addEventListener("click",f,false);
document.addEventListener("touchstart",f,false);