Open automaticdreams opened 7 years ago
@automaticdreams Can you give an example gif? What's supposed to happen instead?
I don't know what should happen
This is edge case, so for example for Dominican republic, which has three possible title/value pairs and only when a user who does have javascript, chooses not to interact with the suggestion list, e.g. Dominican Republic / 1809 Dominican Republic / 1829 Dominican Republic / 1849
The requirement is that a user (when typing) only has to type the country, not the country code too. If the user simply types "Dominican Republic", and does not interact with the suggestion list, there is no way to interpret the user's intention
I don't have any suggestions about how to fix this
Ah I see. This feels like a design issue then. It would be easier to just let the user type their country code rather than only being able to select it from a list no?
yes, needs some design love..... do most users know their country code? could the autocomplete accept the user typing either country OR code? should it force users to type the '+'
Or should we reconsider whether an autocomplete is appropriate here at all, and just use the select....?
Is there actually a use case where a user would type their country and then not interact with the suggestions?
The purpose of the list is to choose a country code, not a country. I'd have thought the use cases for the list would be:
In both cases, they'd end up in the same position as someone who does know their country code. In which case they can either interact with the list to select the right one or type the code directly into a country code input.
it's more a case that a user is able to type in and not interact with the suggestion list they are never asked to type their country code
But that's the information we're ultimately trying to get out of them in this case isn't it?
yes, I know....
If that's the case, I'm not sure this should be an issue raised against the autocomplete pattern (as yes, I'd suspect a select
would work better here) and is indicative of a larger issue:
How do I know if this is the pattern I should be using for this use case or not? And when/how/who do I raise that with in order to either a) come up with more suitable pattern b) design the form more appropriately using existing patterns?
These, however, are process problems and ones we're trying to solve on a bigger scale than github issues affords
a lot of this discussion is also in the original PR https://github.com/hmrc/assets-frontend/pull/714
If a user does not interact with the suggestion list, but simply types their entry, and there are multiple suggestions that match their typing, autoComplete defaults to the first matching option