• Resolved Adam_1

    (@adam_1)


    Hi,

    Is there anyway to get the cursor to focus on search bar when opened?

    Currently being opened through the Twenty Twenty theme search icon button.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author ILLID

    (@mihail-barinov)

    Hello,

    Yes, it is possible. Please add following javascript code

    window.addEventListener('load', function() {
                        var awsSearch = document.querySelectorAll("#site-header .search-toggle");
                        if ( awsSearch ) {
                            for (var i = 0; i < awsSearch.length; i++) {
                                awsSearch[i].addEventListener('click', function() {
                                    window.setTimeout(function(){
                                        document.querySelector(".aws-container .aws-search-field").focus();
                                    }, 100);
                                }, false);
                            }
                        }
    
                    }, false);

    Regards

    Thread Starter Adam_1

    (@adam_1)

    Thank you very much, added and confirmed working!

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

The topic ‘Focus on search’ is closed to new replies.