Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Input Search Field Won’t Focus After Click Magnifying Glass – 2.0 › Reply To: Input Search Field Won’t Focus After Click Magnifying Glass – 2.0
June 25, 2025 at 10:51 am
#54506
Keymaster
That will not fix the issue, it is unrelated to the spinner. This is again caused by a 3rd party script, so I can’t guarantee anything. Normally the plugin does not blur the focus when displaying the results.
Try this variation:
add_action('wp_footer', function () {
?>
<script>
const f = ( select = false ) => {
let input = document.querySelector('.dialog-widget .asp_m input.orig');
if ( input === null ) {
return;
}
input.focus();
if ( select ) {
input.setSelectionRange(0, 9999);
}
}
jQuery(document).on('elementor/popup/show', ()=>{
setTimeout(()=>{f(true);}, 800);
document.querySelectorAll(".asp_main_container").forEach((el) => {
el.addEventListener("asp_search_end", () => {
setTimeout(()=>{f();}, 500);
});
});
});
</script>
<?php
}, 999999);
But again, this is just patching over and over something that may change and cause the conflict to appear again. It would be the best to find what the cause is.