Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › search input issue › Reply To: search input issue
February 26, 2019 at 3:13 pm
#21290
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.