Background goal
We need to solve some usability issues in Lookup:
Issue 1: Inputting a non-valid lookup entry
During a couple of usability sessions, we observed that it's not immediately clear to editors that they must select a result (aka menu item) from the menu to submit a valid (lookup) entry.
What we observed is the following:
- they click on the lookup to focus the field
- they type a query, eg. "string", then
- they move to the next field in the form (via click or tab navigation), without selecting a "valid" query result from the menu, eg. "String"
The lookup looks filled, but it's a non-valid entry, meaning that on form submission the entry is not recorded. When we prompted editors with an error, some didn't understand what was going on, because the lookup look filled.
Issue 2: Modifying pre-selected entries
During usability studies we observed that when a lookup field is pre-filled, it's not immediately clear to editors that the initial value is something that has been pre-selected from a defined list of values. the issue seems to be related by the visual appearance of text in a lookup, which looks exactly like text in a text input component.
When editors try to edit this field, the experience is similar to editing text in a text field, but as soon as you remove one character from the text in the lookup, that entry becomes immediately invalid because it has been not selected from the menu.
Issue 3: Inputting, but not selecting, a valid lookup entry
We need to improve the type+select process. How might we make it clearer that typing is not enough in the Lookup, but that editors must select an option from the menu?
to give you a concrete example:
- you focus the lookup field
- you type "potato"
- you escape focus from the Lookup, click outside/something else
- the "potato" value is entered, but no result from the menu was selected so the entered value is non-valid
What can we do when the entered text is valid (in theory) but invalid for the system (in practice) because the editor didn't click/touch the menu item? Are there ways to make the component usage (visually/interactively/...) more explicit?
Proposed solutions
Solution for issues 1 and 2
If no item from the menu is selected from a required Lookup field, a warning Inline Message should automatically appear within the Field containing the Lookup, alerting the user that no result was selected from the menu. Once the field validation is completed upon form submission, the warning will turn into an error.
Solution to issue 3
When the text entered in the Lookup perfectly matches a menu result, that option could be automatically selected. This will be implemented in a separated task T376466.
Acceptance criteria (or Done)
- There is a solution for each issue described in this task
- Lookup guidelines are updated to represent the desired solution
- Update the Form field demo in the Lookup page including the validation messages for non-valid entries