Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Cursor Gets Lost after Magnifying Glass
This topic contains 1 reply, has 2 voices, and was last updated by Ernest Marcinko 4 years, 4 months ago.
- AuthorPosts
- January 8, 2019 at 3:02 am #20665
After clicking the magnifying glass icon, the search dialog box appears and you would expect to be able to start typing. However, you can’t start typing until you have clicked to place the cursor in the search field.
I don’t see this issue in the demo. Do you know what I could do to correct this?
Thanks!
January 8, 2019 at 10:31 am #20668Hi!
The most likely cause is a 3rd party script, but it is usually very hard to determine which one exactly. I think the best solution in this case is to use a custom code to re-focus the input field once the results are finished displaying.
Add this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!
add_action('wp_footer', 'asp_refocus_input', 10); function asp_refocus_input() { ?> <script> jQuery(function($){ $('.asp_m').on('asp_results_show', function(e, id, instance){ setTimeout(function(){ $('.asp_m_' + id + '_' + instance + ' input.orig').get(0).focus(); }, 200); }); }); </script> <?php }
This should resolve the issue, by forcing the input focus.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
You must be logged in to reply to this topic.