alphagov / govuk-country-and-territory-autocomplete

An autocomplete widget that uses data from Country and Territory Register.
https://alphagov.github.io/govuk-country-and-territory-autocomplete/examples/
MIT License
38 stars 18 forks source link

Don’t show duplicate names in parentheses #48

Closed colinrotherham closed 6 years ago

colinrotherham commented 6 years ago

I know the readme says that location-autocomplete-graph.json "only contains examples" but various entries have duplicated synonyms (in brackets) such as:

French Guiana (French Guiana) French Southern Territories (French Southern Territories) Sint Eustatius (Sint Eustatius)

This pull request hides them if the synonym exactly matches the canonical name.

Otherwise the results list shows the duplicates like this:

duplicates

This is so we can use the list out of the box for prototypes.

gidsg commented 6 years ago

@colinrotherham thanks for flagging this and raising the PR. My feeling is that the correct way to fix this is to publish an updated version of the synonyms without these duplicates, so I will look into doing that in a separate PR.

edwardhorsford commented 5 years ago

Could we consider re-opening this? I agree it's better if the source data didn't include duplicates, but this feels like a nice safety net (possibly to apply to the autocomplete too) if things slip through.