Fix the search box

Fix #277 : autoselect search field
Fix #1107: no spell checking/auto-correct on search field
This commit is contained in:
Samantaz Fox
2021-12-07 04:30:05 +01:00
parent 4f219362fe
commit 68cbc11810
4 changed files with 25 additions and 30 deletions

View File

@@ -0,0 +1,9 @@
<form class="pure-form" action="/search" method="get">
<fieldset>
<input type="search" id="searchbox" autocomplete="off" autocorrect="off"
autocapitalize="none" spellcheck="false" autofocus name="q"
placeholder="<%= translate(locale, "search") %>"
title="<%= translate(locale, "search") %>"
value="<%= env.get?("search").try {|x| HTML.escape(x.as(String)) } %>">
</fieldset>
</form>

View File

@@ -14,11 +14,7 @@
</div>
<div class="pure-u-1-4"></div>
<div class="pure-u-1 pure-u-md-12-24 searchbar">
<form class="pure-form" action="/search" method="get">
<fieldset>
<input autofocus type="search" style="width:100%" name="q" placeholder="<%= translate(locale, "search") %>" value="<%= env.get?("search").try {|x| HTML.escape(x.as(String)) } %>">
</fieldset>
</form>
<%= rendered "components/search_box" %>
</div>
<div class="pure-u-1-4"></div>
</div>

View File

@@ -35,11 +35,7 @@
<a href="/" class="index-link pure-menu-heading">Invidious</a>
</div>
<div class="pure-u-1 pure-u-md-12-24 searchbar">
<form class="pure-form" action="/search" method="get">
<fieldset>
<input type="search" style="width:100%" name="q" placeholder="<%= translate(locale, "search") %>" value="<%= env.get?("search").try {|x| HTML.escape(x.as(String)) } %>">
</fieldset>
</form>
<%= rendered "components/search_box" %>
</div>
<% end %>