-
Notifications
You must be signed in to change notification settings - Fork 109
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
Mmonteith/autocomplete #342
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
In preparation for moving away from jQuery and typeahead and using the GOV.UK autocomplete, remote the jQuery and typeahead dependencies and configurations.
Add the GOV.UK autocomplete dependency connected to the NHS.UK funnelback search autocomplete. Also add some default styling for the autocomplete dropdown that needs finishing.
Updated styling for the search autocomplete on desktop and mobile. Added styling for both`:hover` and `:focus` states. Removed borders and border radius from `autocomplete_menu`. Fixed issue on mobile by adding `width: 100%` to `autocomplete_menu`.
The links in the dropdown were not linking to their relevant page, this has now been fixed. Also corrected some spelling mistakes within the JavaScript functions.
Added existing styling to autocomplete so looks similar to what is live. Amended js to add search icon and 'Search suggestions' title, but there is an issue with it not being created in the right place so this will be looked at.
It is not currently possible to have the search suggestions heading at the top of the dropdown list so this has been removed. Fixed an IE<=11 issue with '.remove()' not supported. Removed the bolding of the typed text because VoiceOver pronounced the search suggestion in a funny way. For example, if you start typing 'he' the results may include 'health', 'behind the headlines', 'heart'. These would be pronounced as 'he' 'alth', 'behind t' 'he' 'he' 'adlines' 'he' 'art' which sounds weird and not really acceptable.
Do checks for search divs and elements to run the autocomplete code, else ignore it it.
chrimesdev
reviewed
Jan 16, 2019
As per our [coding standards](/docs/contributing/coding-standards.md#html)
Removed commented TO DO lines in the defaultConfig.
chrimesdev
approved these changes
Jan 16, 2019
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.
Happy with it from my end @mikemonteith @davidhunter08 what about you?
7 tasks
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.
Cleaned up version of feature/autocomplete branch
Description
The Header component search autocomplete is now using the GOV.UK accessible autocomplete so that we can remove the Typeahead script which requires jQuery.
This is the only component within the Frontend library that requires jQuery, so we can now move away from using jQuery. This will improve performance as we won't have to load in a (large) third party library.
JavaScript bundle before: 53kb + 87 KB jQuery
JavaScript bundle after: 40kb