Skip to content

Commit

Permalink
Merge pull request #118 from zrose584/more_autofocus
Browse files Browse the repository at this point in the history
also autofocus search for /results or on error
  • Loading branch information
user234683 authored Jan 29, 2022
2 parents bb86f78 + 93f445e commit d344c50
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion youtube/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<form id="site-search" action="/youtube.com/results">
<a href="/youtube.com" id="home-link">Home</a>
<input type="search" name="search_query" class="search-box" value="{{ search_box_value }}"
{{ "autofocus" if request.path == "/" else "" }} placeholder="Type to search...">
{{ "autofocus" if (request.path in ("/", "/results") or error_message) else "" }} placeholder="Type to search...">
<button type="submit" value="Search" class="button search-button">Search</button>
<label for="filter-dropdown-toggle-cbox" class="filter-dropdown-toggle-button button">Filter</label>
<input id="filter-dropdown-toggle-cbox" type="checkbox" hidden>
Expand Down

0 comments on commit d344c50

Please sign in to comment.