This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: search input issue

#21290
Ernest MarcinkoErnest Marcinko
Keymaster

Hi,

Thank you! For some reason it only works if I add some delay to the focus script. The final code is then:

add_action('wp_footer', 'asp_focus_on_menu_click');
function asp_focus_on_menu_click() {
  ?>
  <script>
  jQuery(function($){
    $('li.fusion-main-menu-search').on('mouseup touchend', function(){
	  setTimeout(function() { jQuery('.fusion-custom-menu-item-contents .asp_m input.orig').get(0).focus();}, 240);
    });
  });
  </script>
  <?php
}

Once you clear your site and browser cache, it should start working.