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

AP-5170: Country accessible autocomplete #7166

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

agoldstone93
Copy link
Contributor

@agoldstone93 agoldstone93 commented Sep 10, 2024

Replace existing search for countries in non-UK home address with accessible autocomplete

Checklist

Before you ask people to review this PR:

  • Tests and rubocop should be passing: bundle exec rake
  • Github should not be reporting conflicts; you should have recently run git rebase main.
  • The standards in the Git Workflow document on Confluence should be followed
  • There should be no unnecessary whitespace changes. These make diffs harder to read and conflicts more likely.
  • The PR description should say what you changed and why, with a link to the JIRA story.
  • You should have looked at the diff against main and ensured that nothing unexpected is included in your changes.
  • You should have checked that the commit messages say why the change was made.

@agoldstone93 agoldstone93 force-pushed the testing-country-accessible-autocomplete branch from 080abe8 to de2251d Compare September 24, 2024 12:32
@agoldstone93 agoldstone93 force-pushed the testing-country-accessible-autocomplete branch from 37d9ea9 to fc002b1 Compare October 1, 2024 16:24
Copy link

sonarqubecloud bot commented Oct 1, 2024

@agoldstone93 agoldstone93 force-pushed the testing-country-accessible-autocomplete branch from fc002b1 to 0c7b2c9 Compare November 7, 2024 08:16
@agoldstone93 agoldstone93 force-pushed the testing-country-accessible-autocomplete branch from 0c7b2c9 to f4a084b Compare November 28, 2024 08:31
@agoldstone93 agoldstone93 changed the title Testing country accessible autocomplete Country accessible autocomplete Nov 28, 2024
@agoldstone93 agoldstone93 marked this pull request as ready for review November 28, 2024 13:11
@agoldstone93 agoldstone93 requested a review from a team as a code owner November 28, 2024 13:11
Comment on lines 1 to 9
.clear-search {
margin-top: 50px;

&-error {
margin-top: 90px;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RWD: would it be ideal to use the govuk spacing mixin and values?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The values only go up to 60px, sadly

I could do something funky like have the 50px always there and add the extra 40px when there's an error, by either using variables or adding the margin to two separate elements, but they didn't seem right. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing funky.
Funky is not standard practice and it always becomes a pain.

As the max value is only 60px. I would suggest we test the responsiveness of your units.

@@ -0,0 +1,42 @@
import accessibleAutocomplete from 'accessible-autocomplete'
Copy link
Contributor

@naseberry naseberry Nov 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Componentization improvement: These functions would only work with one accessible component per page, that works for well for our current page layout, could this be made better to by supporting multiple autocompletes on single page

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@naseberry Do we need this? I think we'll only ever have one on a page. If so, I'm not sure exactly what you mean or how to achieve it

@agoldstone93 agoldstone93 changed the title Country accessible autocomplete AP-5170: Country accessible autocomplete Dec 3, 2024
@agoldstone93 agoldstone93 force-pushed the testing-country-accessible-autocomplete branch from 543f510 to b1391d8 Compare December 5, 2024 13:39
@agoldstone93 agoldstone93 force-pushed the testing-country-accessible-autocomplete branch from b1391d8 to f08dd2d Compare December 17, 2024 13:37
Reorder validation to change the order it's displayed.
Add class to connect accessible autocomplete using class
rather than existing id as this changes when there is
an error.
Clear search not shown when js is off.
Add 'govuk-body' class to update font.
Clear search working when js is off.
Don't run autocomplete js on other pages
Update tests to reflect changes
Fix vertical alignment when there is an error on the page
Add class to autocomplete when there is an error. Seems to change color
back to black once the user starts typing in an answer. This may not
be preferable.
Add and remove existing class to show and hide elements
Move text into locales files
Following responsive web design, this removes unnecessary extra
spacing when on non-desktop devices
@agoldstone93 agoldstone93 force-pushed the testing-country-accessible-autocomplete branch from f08dd2d to bd3e0e7 Compare December 23, 2024 11:44
Update javascript code so accessible autocomplete component is reusable
@agoldstone93 agoldstone93 force-pushed the testing-country-accessible-autocomplete branch from ed0d43a to f86e737 Compare December 23, 2024 13:53
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.

2 participants