Skip to content

Commit

Permalink
Prevent corrections and completions in search field
Browse files Browse the repository at this point in the history
In particular mobile browsers use correction mechanisms on input fields.
Search will often be done with technical terms or even class/method/etc
names that these correction mechanisms do not know, resulting in
unwanted changes. This PR deactivates these correction mechanisms.

I've also reported this upstream to sphinx at
sphinx-doc/sphinx#9307. See there for more
background.

Our current theme uses customized templates, so we have to adapt this
ourselves.

You can also that this is working by accessing the CI built docs with
a mobile device, and compare that with the released docs.
  • Loading branch information
timhoffm authored and jklymak committed Jun 11, 2021
1 parent 090615a commit d83d72a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/_templates/layout.html
Expand Up @@ -63,7 +63,7 @@
<li><a href="{{ pathto('devel/index') }}">Contributing</a></li>
<li class="nav-right">
<form class="search" action="{{ pathto('search') }}" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" placeholder="Search"/>
<input type="text" name="q" aria-labelledby="searchlabel" placeholder="Search" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
</form>
</li>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion doc/_templates/search.html
Expand Up @@ -17,7 +17,7 @@ <h1 id="search-documentation">{{ _('Search') }}</h1>
"codex ellipse".
</p>
<form action="" method="get">
<input type="text" name="q" value="" />
<input type="text" name="q" value="" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="{{ _('search') }}" />
<span id="search-progress" style="padding-left: 10px"></span>
</form>
Expand Down

0 comments on commit d83d72a

Please sign in to comment.