-
Notifications
You must be signed in to change notification settings - Fork 20
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
Allow disabling search
input spelling corrections
#4112
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
maxgds
approved these changes
Jul 24, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find the logic a bit muddled - set a thing to true to make sure some things get turned off . I can see why it's been done that way, though, so happy to let it through.
As part of our work on site search, we've discovered a pain point where mobile browsers' autocorrection features mess up user queries, especially when it comes to domain specific terminology. For example, searches for "HMRC" are frequently autocorrected to "Hercules", or searches for "SORN" to "sworn". As our new site search engine used by Search API v2 is much better at implicitly handling misspelled user queries than the previous search engine, we want to allow disabling all mobile browser attempts at second guessing what the user has typed as the end result tends to be worse with two separate spellchecks turning into a game of query telephone. - Add `disable_corrections` parameter to `search` component that can be set to true to disable both `autocorrect` and `autocapitalize` attributes on the search input field [^1] [^1]: Note that there is little by way of standardisation for this behaviour, and indeed MDN refers to the `autocorrect` attribute as Safari-only, but in practice Chrome for Android honours it as well, see https://issues.chromium.org/issues/40335663
csutter
added a commit
that referenced
this pull request
Jul 24, 2024
This applies the `disable_corrections` setting from #4112 to the `search` components used in the `layout_super_navigation_header` and `layout_header` components. We expect this to improve the quality of search results for users on mobile as their browsers will no longer excessively autocorrect, and in case of genuine misspellings, the site search engine can cope with that well anyway.
This was referenced Jul 24, 2024
Merged
csutter
added a commit
to alphagov/frontend
that referenced
this pull request
Jul 30, 2024
As part of our work on site search, we've discovered a pain point where mobile browsers' autocorrection features mess up user queries, especially when it comes to domain specific terminology. For example, searches for "HMRC" are frequently autocorrected to "Hercules", or searches for "SORN" to "sworn". - Bump `govuk_publishing_components` to 40.1.0 - Set `disable_corrections` parameter to `search` component in homepage header See: alphagov/govuk_publishing_components#4112
csutter
added a commit
to alphagov/finder-frontend
that referenced
this pull request
Jul 30, 2024
As part of our work on site search, we've discovered a pain point where mobile browsers' autocorrection features mess up user queries, especially when it comes to domain specific terminology. For example, searches for "HMRC" are frequently autocorrected to "Hercules", or searches for "SORN" to "sworn". - Set `disable_corrections` parameter for all uses of `search` component See: alphagov/govuk_publishing_components#4112
csutter
added a commit
to alphagov/finder-frontend
that referenced
this pull request
Jul 30, 2024
As part of our work on site search, we've discovered a pain point where mobile browsers' autocorrection features mess up user queries, especially when it comes to domain specific terminology. For example, searches for "HMRC" are frequently autocorrected to "Hercules", or searches for "SORN" to "sworn". - Set `disable_corrections` parameter for all uses of `search` component See: alphagov/govuk_publishing_components#4112
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
disable_corrections
parameter tosearch
component that can be set to true to disable bothautocorrect
andautocapitalize
attributes on the search input field 1Why
As part of our work on site search, we've discovered a pain point where mobile browsers' autocorrection features mess up user queries, especially when it comes to domain specific terminology. For example, searches for "HMRC" are frequently autocorrected to "Hercules", or searches for "SORN" to "sworn".
As our new site search engine used by Search API v2 is much better at implicitly handling misspelled user queries than the previous search engine, we want to allow disabling all mobile browser attempts at second guessing what the user has typed as the end result tends to be worse with two separate spellchecks turning into a game of query telephone.
Behaviour
Before
After
(note that the autocorrect suggestions are still displayed, but not automatically applied)
Footnotes
Note that there is little by way of standardisation for this behaviour, and indeed MDN refers to the
autocorrect
attribute as Safari-only, but in practice Chrome for Android honours it as well, see https://issues.chromium.org/issues/40335663 ↩