Skip to content

Commit

Permalink
Autofocus the search bar on the front page (#4581)
Browse files Browse the repository at this point in the history
Fix #4575
  • Loading branch information
joelverhagen committed Aug 22, 2017
1 parent 0442825 commit 0968fe9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/NuGetGallery/Views/Pages/Home.cshtml
@@ -1,6 +1,7 @@
@{
ViewBag.Title = "Home";
ViewBag.ShowSearchInNavbar = false;
ViewBag.AutofocusSearch = true;
ViewBag.HasJumbotron = true;
Layout = "~/Views/Shared/Gallery/Layout.cshtml";
}
Expand Down
3 changes: 2 additions & 1 deletion src/NuGetGallery/Views/Shared/_SearchBar.cshtml
@@ -1,7 +1,8 @@
<div class="input-group">
<input name="q" type="text" class="form-control" id="search"
placeholder="Search for packages..." autocomplete="off"
value="@(String.IsNullOrEmpty(ViewBag.SearchTerm) ? "" : ViewBag.SearchTerm)" />
value="@(String.IsNullOrEmpty(ViewBag.SearchTerm) ? "" : ViewBag.SearchTerm)"
@(ViewBag.AutofocusSearch == true ? "autofocus" : string.Empty) />
<span class="input-group-btn">
<button class="btn btn-default btn-warning btn-search" type="submit"
title="Search for packages" aria-label="Search">
Expand Down

0 comments on commit 0968fe9

Please sign in to comment.