8000 Prevent corrections and completions in search field · matplotlib/matplotlib@98ef540 · GitHub
[go: up one dir, main page]

Skip to content

Commit 98ef540

Browse files
committed
Prevent corrections and completions in search field
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.
1 parent 63261cc commit 98ef540

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

doc/_templates/layout.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
<li><a href="{{ pathto('devel/index') }}">Contributing</a></li>
6464
<li class="nav-right">
6565
<form class="search" action="{{ pathto('search') }}" method="get">
66-
<input type="text" name="q" aria-labelledby="searchlabel" placeholder="Search"/>
66+
<input type="text" name="q" aria-labelledby="searchlabel" placeholder="Search" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
6767
</form>
6868
</li>
6969
</ul>

doc/_templates/search.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ <h1 id="search-documentation">{{ _('Search') }}</h1>
1717
"codex ellipse".
1818
</p>
1919
<form action="" method="get">
20< 55D0 /code>-
<input type="text" name="q" value="" />
20+
<input type="text" name="q" value="" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
2121
<input type="submit" value="{{ _('search') }}" />
2222
<span id="search-progress" style="padding-left: 10px"></span>
2323
</form>

0 commit comments

Comments
 (0)
0