Fix autofocus of input fields

This commit is contained in:
James Mills
2021-02-02 16:39:12 +10:00
parent f47e9ba765
commit e34e331101
3 changed files with 67 additions and 65 deletions

View File

@@ -7,7 +7,7 @@
</hgroup>
<form action="/add" method="POST">
<input type="hidden" name="csrf_token" value="{{ $.CSRFToken }}">
<input type="url" name="url" placeholder="Website's URL" aria-label="URL" autocomplete="url" required>
<input type="url" name="url" placeholder="Website's URL" aria-label="URL" autocomplete="url" autofocus required>
<button type="submit" class="primary">
<i class="icss-plus"></i>
Add

View File

@@ -1,7 +1,7 @@
{{define "content"}}
<div class="container">
<form action="/search" method="GET">
<input type="text" id="search" name="q" placeholder="{{ $.SearchPrompt }}" value="{{ $.SearchQuery }}">
<input type="text" id="search" name="q" placeholder="{{ $.SearchPrompt }}" value="{{ $.SearchQuery }}" autofocus required>
<button id="go" type="submit">
<i class="icss-search"></i>
Go!

View File

@@ -1,7 +1,7 @@
{{define "content"}}
<div class="container">
<form action="/search" method="GET">
<input type="text" id="search" name="q" placeholder="{{ $.SearchPrompt }}" value="{{ $.SearchQuery }}">
<input type="text" id="search" name="q" placeholder="{{ $.SearchPrompt }}" value="{{ $.SearchQuery }}" autofocus required>
<button id="go" type="submit">
<i class="icss-search"></i>
Go!
@@ -12,7 +12,9 @@
{{ with $.Results }}
<ol>
{{ range . }}
<li><a href="{{ .URL }}">{{ .Title }}</a><p{{ if .Summary }}>{{ .Summary }}{{ else }} class="placeholder">No summary available{{ end }}</p><p class="small"><a href="{{ .URL }}">{{ .URL }}</a> {{ .Length }} <a href="/cache?id={{ .ID }}">View cached</a></p>
<li><a href="{{ .URL }}">{{ .Title }}</a>
<p{{ if .Summary }}>{{ .Summary }}{{ else }} class="placeholder">No summary available{{ end }}</p>
<p class="small"><a href="{{ .URL }}">{{ .URL }}</a> {{ .Length }} <a href="/cache?id={{ .ID }}">View cached</a></p>
{{ end }}
</ol>
<p>If your page appears here and you do not want it to, please contact <a href="/support">Support</a>.</p>