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

Remove the jQuery dependency requirement #320

Closed
chrimesdev opened this issue Dec 24, 2018 · 1 comment
Closed

Remove the jQuery dependency requirement #320

chrimesdev opened this issue Dec 24, 2018 · 1 comment

Comments

@chrimesdev
Copy link
Member

chrimesdev commented Dec 24, 2018

The Header component search autocomplete uses Typeahead which requires jQuery, this has been used on the live NHS.UK website for a while. This is the only component within the Frontend library that requires jQuery, and we want to move away from using jQuery, mainly for performance improvements by not having to load in a (large) third party library.

Research and development has started into using the GOV.UK accessible autocomplete so that we can remove the Typeahead script.

chrimesdev added a commit that referenced this issue Jan 2, 2019
In preparation for moving away from jQuery and typeahead and using the
GOV.UK autocomplete, remote the jQuery and typeahead dependencies and
configurations.
chrimesdev added a commit that referenced this issue Jan 2, 2019
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.
chrimesdev added a commit that referenced this issue Jan 2, 2019
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.
chrimesdev added a commit that referenced this issue Jan 2, 2019
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.
chrimesdev added a commit that referenced this issue Jan 2, 2019
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.
chrimesdev added a commit that referenced this issue Jan 2, 2019
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.
chrimesdev added a commit that referenced this issue Jan 2, 2019
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.
chrimesdev added a commit that referenced this issue Jan 2, 2019
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.
chrimesdev added a commit that referenced this issue Jan 2, 2019
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.
davidhunter08 added a commit that referenced this issue Jan 4, 2019
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`.
davidhunter08 pushed a commit that referenced this issue Jan 4, 2019
In preparation for moving away from jQuery and typeahead and using the
GOV.UK autocomplete, remote the jQuery and typeahead dependencies and
configurations.
davidhunter08 pushed a commit that referenced this issue Jan 4, 2019
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.
davidhunter08 added a commit that referenced this issue Jan 4, 2019
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`.
chrimesdev pushed a commit that referenced this issue Jan 8, 2019
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.
mcheung-nhs added a commit that referenced this issue Jan 11, 2019
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.
mcheung-nhs added a commit that referenced this issue Jan 15, 2019
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.
mcheung-nhs pushed a commit that referenced this issue Jan 15, 2019
In preparation for moving away from jQuery and typeahead and using the
GOV.UK autocomplete, remote the jQuery and typeahead dependencies and
configurations.
mcheung-nhs pushed a commit that referenced this issue Jan 15, 2019
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.
mcheung-nhs pushed a commit that referenced this issue Jan 15, 2019
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`.
mcheung-nhs pushed a commit that referenced this issue Jan 15, 2019
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.
mcheung-nhs added a commit that referenced this issue Jan 15, 2019
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.
mcheung-nhs added a commit that referenced this issue Jan 15, 2019
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.
mcheung-nhs added a commit that referenced this issue Jan 15, 2019
Removed merge messages from previous merge, which was missed.
mcheung-nhs added a commit that referenced this issue Jan 16, 2019
Do checks for search divs and elements to run the autocomplete code,
else ignore it it.
mcheung-nhs added a commit that referenced this issue Jan 16, 2019
As per our [coding standards](/docs/contributing/coding-standards.md#html)
mcheung-nhs added a commit that referenced this issue Jan 16, 2019
Removed commented TO DO lines in the defaultConfig.
@mcheung-nhs
Copy link
Collaborator

New autocomplete (minus jQuery) merged in here:
PR 342
so closing this issue.

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

No branches or pull requests

2 participants