Typing with one click

This topic contains 1 reply, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 3 years, 3 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #30670
    pdaxenbichler87
    pdaxenbichler87
    Participant

    Hi,
    we use your plugin on our website https://fs1.tv/ and we really like it. We only want to improve one usability thing: When clicking on the search-symbol, the search-text-field opens. But then the user is not able to type in the search term – he has to click again in the search field and then he is able to write the search term.

    How is it possible to search without this last click?

    Thanks!

    For your information, we have two licenses of your plugin – also here https://radiofabrik.at/ – and here its the same.

    Patrick

    #30685
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Patrick,

    Well, that needs to be custom coded, so that the menu click triggers a focus on the input. Some search menu icons have that pre-programmed, for others a small code is needed. This one should cover your case:

    add_action('wp_footer', 'asp_add_menu_focus_trigger');
    function asp_add_menu_focus_trigger() {
      ?>
      <script>
    	jQuery(function($){
    		$('.nav-search-link').on('click', function(){
    			$('.nav-search-form').find('input.orig').get(0).focus();
    		});
    	});
      </script>
      <?php
    }

    Try adding 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!

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.