• moesosu

    (@moesosu)


    Hello all, I have a problem with the plugin on my website, let me explain

    When the user presses the search button glass (located to the right of my main menu) the Ajax search engine is displayed. If people start typing the word they want to search for, they don’t start searching for it, they have to press again in the search box to write again the text that they want to search.

    Anyone knows what happens? Thanks in advance people!
    Excuse me for my english ??

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author wpdreams

    (@wpdreams)

    Hi,

    The issue is not directly related to Ajax Search Lite, but I can tell you why it happens.

    It looks like the theme has this fancy search script, when clicking on the icon the search bar shows up. Whenever the icon is clicked it tries to find the input field and focus it. Ajax Search Lite however has two inputs there, one is for search and the other is the autocomplete field. Unfortunately that script focuses the autocomplete field.

    The best way to get around it is by editing the theme search script to focus the correct element. You can also try a custom code:

    add_action('wp_footer', 'asl_add_footer_script', 9999);
    function asl_add_footer_script() {
    	?>
    	<script>
    	jQuery(function($){
    		$("#menu-item-search").on("click", function() { 
    			setTimeout(function(){
    				$('input.orig').get(0).focus();
    			}, 300);
    		});
    	});
    	</script>
    	<?php
    }

    This will override the click behavior and focus the correct element.

    Best,
    Ernest M.

    • This reply was modified 2 years ago by wpdreams.
    Thread Starter moesosu

    (@moesosu)

    Thank you for your help, Ernest.
    I will try to use the script you send me in my theme.

    Best regards, and thanks a lot again!

    Plugin Author wpdreams

    (@wpdreams)

    You are very welcome, let me know if it works!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Search box – Typing problem’ is closed to new replies.