webapi: Use input type "search" for ticket hash.

The "search" input type is functionally the same as "text" but has a nice extra property - most browsers will render it with a "Clear" button to wipe the current input.

Also disable spellchecking on this input.
This commit is contained in:
jholdstock 2023-06-26 13:21:57 +01:00 committed by Jamie Holdstock
parent ac973bd056
commit 78cf99bc2c
2 changed files with 8 additions and 1 deletions

View File

@ -9,6 +9,13 @@ body {
flex-direction: column; flex-direction: column;
} }
/* Bootstrap adds ugly outlines to search inputs. Setting outline-offset and
appearance makes them look the same as text inputs. */
input[type="search"] {
outline-offset: 0;
appearance: auto;
}
.navbar { .navbar {
background-color: #F9FAFA; background-color: #F9FAFA;
} }

View File

@ -178,7 +178,7 @@
<section> <section>
<form class="mt-2 mb-4" action="/admin/ticket" method="post"> <form class="mt-2 mb-4" action="/admin/ticket" method="post">
<input type="text" name="hash" size="64" minlength="64" maxlength="64" required placeholder="Ticket hash" autocomplete="off" <input type="search" name="hash" size="64" minlength="64" maxlength="64" spellcheck="false" required placeholder="Ticket hash" autocomplete="off"
{{ with .SearchResult }} {{ with .SearchResult }}
value="{{ .Ticket.Hash }}" value="{{ .Ticket.Hash }}"
{{ end }}> {{ end }}>