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

Mmonteith/autocomplete #342

Merged
merged 15 commits into from
Jan 16, 2019
Merged

Mmonteith/autocomplete #342

merged 15 commits into from
Jan 16, 2019

Conversation

mcheung-nhs
Copy link
Collaborator

@mcheung-nhs mcheung-nhs commented Jan 16, 2019

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

chrimesdev and others added 11 commits January 4, 2019 10:57
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.
As per our [coding standards](/docs/contributing/coding-standards.md#html)
Removed commented TO DO lines in the defaultConfig.
Copy link
Member

@chrimesdev chrimesdev left a 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?

@chrimesdev chrimesdev merged commit c3f6189 into master Jan 16, 2019
@chrimesdev chrimesdev deleted the mmonteith/autocomplete branch January 16, 2019 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants