govuk-country-and-territory-autocomplete
govuk-country-and-territory-autocomplete copied to clipboard
Synonyms are not always shown in the results list
In the example below you can see that when typing 'un', 'Burma' is returned as a result, but with no alias given, which makes it hard to understand why it's in the list (same goes for 'Egypt').
If you look in the data you’ll see:
- A country code, MM, which is named ‘Burma’
- A synonym for MM, which is named ‘Union of Burma’
So it appears to be matching the ‘Un’ of ‘Union of Burma’, but not outputting the synonym in the list. This may be a design choice rather than a bug, but in this example it's producing a confusing result.
I think this may be related to it having old data.
The synonyms have a concept of being 'canonical' or 'non-canonical' - are they official or not. A typo would be non-canonical, whilst an official name would. Matches against canonical names get shown in brackets, but not non-canonical ones don't show in brackets - in this case, 'Union of Burma' should probably be marked as canonical. At one point there were many cases like this and I think we were waiting on an updated data file.