Skip to content

Add autofocus attribute to search template #229

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

dariusk
Copy link

@dariusk dariusk commented Apr 12, 2013

I think it would increase the usability of any of the jQuery websites with a search widget to have the search input autofocus the keyboard input. I did a cursory review of a bunch of the jQuery sites that use the search template, and in every case I looked at, adding autofocus would make it easier to search (and there didn't seem to be any existing functionality it would clobber).

@eddiemonge
Copy link
Contributor

I disagree with this. If every person that came to the site searched as the first thing they did, then yes this would be a good idea. However, that is not the case here. Search is something that is done secondary. Viewing the content is primary. If I land on http://api.jquery.com/add/ for example, I want to scroll down the page to see more info. I can't use arrows or the space bar if the search box takes autofocus.

@scottgonzalez
Copy link
Member

I agree with @eddiemonge.

@kswedberg
Copy link
Member

Thoughts on having autofocus on category pages only? Or would the inconsistency be problematic?

@scottgonzalez
Copy link
Member

It'd be a bit strange if you were on the home page, click on a category from the sidebar, then end up in a search field.

@rdworth
Copy link
Contributor

rdworth commented May 14, 2013

I agree. I don't think autofocus should be used for the search field on any of our sites/pages. An exception would be an advanced search page where a search field is the only content on the page, but we don't have one today.

@pudly
Copy link

pudly commented Jun 11, 2013

There is an accessibility consideration to this. Relatively well captured in http://www.sitepoint.com/dont-hijack-my-browser/

That said, there are ways around it as well:

http://www.impressivewebs.com/backspace-back-button-autofocus/

That's my 2c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

6 participants