4

How to prevent cursor's default position being on Search box?

Kind of stupid question, but it's something really annoying sometimes: Can anyone tell me how can I prevent cursor being on Search Box all the time? In all pages, even in login page where user is going to type his credentials, the cursor is at search box, so in any page, users have to waste a click somewhere in the page, to take focus from search box and then be able to navigate...

I think they are more probable to want to scroll down in a page than type a search.

zaf's avatar
512
zaf
asked 2012-05-13 09:35:28 -0500
edit flag offensive 0 remove flag close merge delete

Comments

3

Yes, we will fix that, agreed.

Evgeny's avatar Evgeny (2012-05-13 10:41:07 -0500) edit

thanks man for being active :) it's really helpful. So, the cursor thing is not something I can easily change? It requires a lot of updates?

zaf's avatar zaf (2012-05-13 10:45:58 -0500) edit

Too bad, did not include this fix into the 0.7.43 release, was preoccupied with other issues, but we'll make another one very shortly. We'll be trying to release features/fixes as soon as they are ready from now on. There's been about a month between .43 and .42.

Evgeny's avatar Evgeny (2012-05-14 14:48:57 -0500) edit

This is particularly annoying in Firefox because the act of focusing the search box scrolls it into view which means that links to answers and comments don't work, and also the back button loses its place.

Neil's avatar Neil (2014-02-23 06:34:24 -0500) edit
add a comment see more comments

1 Answer

1

Probably a hack, but you can add the following

    <script type="text/javascript" charset="utf-8">
       $(document).ready(function() {
            elements = $('.searchInput');
            elements.each(function() {$(this).blur()});  
        });
    </script>

in the pages you want to deactivate the focus in search input. If you want to disable it in all pages, you can add this code in base.html

alexandros.z's avatar
596
alexandros.z
answered 2012-05-14 14:40:41 -0500
edit flag offensive 0 remove flag delete link

Comments

We just need to focus on the input only on some pages, in fact we have special classes set on the body element, that we could use to detect the pages where we need the focus.

Evgeny's avatar Evgeny (2012-05-14 14:46:50 -0500) edit

In a hypothetical scenario, that I would like to remove focus from search input in all pages, what would you suggest?

alexandros.z's avatar alexandros.z (2012-05-14 14:58:14 -0500) edit

Then you could apply your solution. By default we'll be focusing the cursor on the most relevant field, but if you would like to override that - just add custom js to the bottom of the pages.

Evgeny's avatar Evgeny (2012-05-15 10:48:27 -0500) edit
add a comment see more comments