Skip to content
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

Please put focus on the search input control when nuget.org loads #4575

Closed
guardrex opened this issue Aug 18, 2017 · 9 comments
Closed

Please put focus on the search input control when nuget.org loads #4575

guardrex opened this issue Aug 18, 2017 · 9 comments
Assignees

Comments

@guardrex
Copy link

I frequently show up to nuget.org with a package name on my clipboard to paste. PLEASE set the focus to the search <input> element on the homepage so that when the page loads we can just paste (Ctrl-v) and hit Enter to get our package search results.

@anangaur
Copy link
Member

Makes sense. Similar to #4458
Today the focus goes to the search bar the moment you start typing.
@joelverhagen can this be also enabled for Ctrl key (so that Ctrl+v can work) without hampering the accessibility requirements?

@guardrex
Copy link
Author

I see what u mean. Thing is tho ... about 99% of the time, I'm coming in with clipboard contents to paste. It's a package that I've snipped from an online source or from a project file.

The search element just needs an autofocus attribute. There shouldn't be a prob with accessibility, e.g., see: http://webaim.org/blog/future-web-accessibility-html5-input-extensions/. It wouldn't be implemented here in a way that would break or confuse a screen reader. The primary purpose of the nuget.org homepage IS to search for packages, so setting the focus on the search box makes perfect sense.

Thanks for considering this (and my mouse thanks you! 😄)

@guardrex
Copy link
Author

guardrex commented Aug 18, 2017

This is a bit of a dupe of #4458, but imo that issue/PR doesn't fix the problem. 😢

@robertmuehsig
Copy link
Contributor

Whats the problem with autofocus? Worked quite well in the older portal.

@joelverhagen
Copy link
Member

Perhaps we can autofocus just on the front page. Would that improve the situation for you, @guardrex? By default autofocusing the search bar on all pages could be frustrating for pages that have forms.

@guardrex
Copy link
Author

I agree. I suspected your partial there was in use in other places; otherwise, you wouldn't have used a partial at all. I'll close and let u cats take over. Thanks for taking this into consideration.

@joelverhagen
Copy link
Member

@guardrex, mind if I leave this open? I think it's a good idea to autofocus the main page. We can use this issue to track that work. Concerning the partial view, we can add a parameter to enable/disable autofocus I think (or perhaps do it based off of page URL).

@joelverhagen joelverhagen reopened this Aug 18, 2017
@guardrex
Copy link
Author

Sure.

do it based off of page URL

Can be unstable, of course, depending on how its implemented, which is why I think a lot of devs base it either on detecting the controller that fires or by, as you say, a parameter like ViewBag.IsHome. My gut feel'in: Probably most reliable (and simple) to go the parameter way.

@agr
Copy link
Contributor

agr commented Aug 18, 2017

FYI, if you are using Chrome, you can set up "Nuget package search" there like this (It's under Settings -> Search engine -> Manage search engines):
image
Then while in address bar you just press n, then space, then paste your package name and press enter, and you'll get directly to search results page. No need to visit nuget.org home page.
image

Other browsers might provide similar capabilities, I don't know how to set them up though.

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

Successfully merging a pull request may close this issue.

5 participants