• Resolved tiemann

    (@tiemann)


    Hey guys,

    when I click on the search icon and the search bar opens, the field is apparently not active. So if I enter a search term, no search is started. only after I click in the field the search is active. Is there a possibility that if I click on the search icon and the search bar opens, this is directly active?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter tiemann

    (@tiemann)

    Here two screenshots of the problem.

    Not active after i clicked the search icon:
    https://prnt.sc/o7ch8j

    Active after i clicked in the search bar:
    https://prnt.sc/o7ci0k

    The goal is that the search box is active immediately after clicking on the icon.

    Plugin Author wpdreams

    (@wpdreams)

    Hi,

    Well, this requires a custom script for sure, to focus the search text field input after clicking that icon – since it is not part of the plugin itself.
    Can you share a URL where I could take a look at this structure? Then I might be able to suggest a modification to make this work.

    Best,
    Ernest M.

    Thread Starter tiemann

    (@tiemann)

    Hey Ernest,

    unfortunately I can not give you a url. this is a portal of a university that is only available as a student.
    do you have another idea or can you help me otherwise? a codesnipped would theoretically be enough.
    that would be great.

    Thanks.
    Chris

    Plugin Author wpdreams

    (@wpdreams)

    Hi Chris,

    I’m afraid this is impossible without actually seeing the HTML structre. Otherwise I am not able to construct the snippet.

    Best,
    Ernest M.

    Thread Starter tiemann

    (@tiemann)

    Hey Ernest,
    I can send you a url on thursday with access data.
    Can you give me your emailadress? Thank you for your help.

    Chris

    Plugin Author wpdreams

    (@wpdreams)

    Hi!

    Got your message. 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!

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

    This should do the trick. Make sure to clear all layers of cache as well, so the script is active.

    Best,
    Ernest M.

    Thread Starter tiemann

    (@tiemann)

    hey ernest,

    That worked! Perfect! Many thanks for the quick support.
    many Greetings

    Chris

    Plugin Author wpdreams

    (@wpdreams)

    Great! I will mark this as resolved now. Feel free to rate the plugin if you like it.

    Best,
    Ernest M.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘searchfield not “active”’ is closed to new replies.