How can I auto focus the search field in my online store?

when customer click the search icon in the store then a drawer will come and customers need to click the search field to enter . i need to auto select the field so that customer can enter the text directly after the icon pressed.

store link - https://boyodemo.myshopify.com

Code - function search(){
$(‘.js-search-destop’).on(‘click’, function() {
$(‘.js-box-search’).addClass(‘active’);
$(‘.bg_search_box’).addClass(‘active’);
$(‘body’).addClass(‘activedestop’);
setTimeout(()=>{
$(‘.js-box-search’).find(‘.search-input’).focus();
},1000);
});
$(‘.js-drawer-close’).on(‘click’, function() {
$(‘.js-box-search’).removeClass(‘active’);
$(‘.bg_search_box’).removeClass(‘active’);
$(‘body’).removeClass(‘activedestop’);
});
$(‘.bg_search_box’).on(‘click’, function() {
$(‘.js-box-search’).removeClass(‘active’);
$(‘.bg_search_box’).removeClass(‘active’);
$(‘body’).removeClass(‘activedestop’);
});
}