Ask Your Question

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

asked 2012-05-13 09:35:28 -0500

zaf's avatar

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.

edit retag flag offensive close merge delete



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

1 Answer

Sort by ยป oldest newest most voted

answered 2012-05-14 14:40:41 -0500

alexandros.z's avatar

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()});  

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

edit flag offensive delete link more


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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2012-05-13 09:35:28 -0500

Seen: 338 times

Last updated: May 14 '12