-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add default value to autocomplete input
Adding the accessible autocomplete element meant that when completing a text search from the home page (non-js route) the input value is no longer populated when the search page is loaded. We have added a default value on init autocomplete. There is a known issue with autocomplete (alphagov/accessible-autocomplete#424), that setting a default value results in a suggestion with the text 'undefined'. This is bedause the default value is treated as a selected item, even though it is likely to be a partial search term, and is a string instead of an Aucomplete empty object. The workaround for this is to check if the result is a string when setting the custom template.
- Loading branch information
1 parent
8db68a9
commit abba43b
Showing
2 changed files
with
30 additions
and
16 deletions.
There are no files selected for viewing
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
44 changes: 29 additions & 15 deletions
44
DfE.FindInformationAcademiesTrusts/assets/javascripts/autocomplete.js
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