Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent corrections and completions in search field #9307

Merged
merged 1 commit into from Jun 13, 2021

Conversation

timhoffm
Copy link
Contributor

@timhoffm timhoffm commented Jun 7, 2021

Purpose

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.

Detail

While I haven't been able to find official reference documentation on
these input attributes, there are multiple sources, describing this, e.g.

References:

I did not find official reference docs on autocorrect and autocapitalize, but
they are mentioned in various sources, e.g.

and it works, as can easily be checked with a mobile device on the demos in the above
links.

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.

While I haven't been able to find official reference documentation on
these input attributes, there are multiple sources, describing this, e.g.

References:

- Autocomplete: https://www.w3schools.com/howto/howto_html_autocomplete_off.asp
- Spellckeck: https://www.w3schools.com/howto/howto_html_spellcheck_disable.asp

I did not find official reference docs on autocorrect and autocapitalize, but
they are mentioned in various sources, e.g.

- https://mgearon.com/html/disable-autocomplete-autocapitalize-and-autocorrect/
- https://stackoverflow.com/questions/35513968/disable-auto-correct-in-safari-text-input
- https://davidwalsh.name/disable-autocorrect

and it works, as can easily be checked with a mobile device on the demos in the above
links.
timhoffm added a commit to timhoffm/matplotlib that referenced this pull request Jun 7, 2021
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.
jklymak pushed a commit to jklymak/matplotlib that referenced this pull request Jun 13, 2021
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.
@tk0miya tk0miya added this to the 4.1.0 milestone Jun 13, 2021
@tk0miya tk0miya merged commit 99bfdb6 into sphinx-doc:4.x Jun 13, 2021
@tk0miya
Copy link
Member

tk0miya commented Jun 13, 2021

Thanks!

tk0miya added a commit that referenced this pull request Jun 13, 2021
@timhoffm timhoffm deleted the search-corrections branch June 13, 2021 13:20
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants