Page MenuHomePhabricator

Lookup: automatic selection when the text typed matches with one result
Open, MediumPublic3 Estimated Story Points

Description

Background

As part of the solutions listed in T362650 to solve the Lookup usability issues for non-valid results, we need to automatically select the item from the menu when it matches with the text typed within the Lookup.

Captura de pantalla 2024-10-07 a las 11.50.32.png (526×1 px, 48 KB)

NOTE: The automatic selection should also be applied to the Combobox in T376599, as both components involve typing text within an input and selecting an item from the menu.

Open Questions

  • What events should be emitted on automatic selection, if any?
  • Should this be an option or always the default?
  • Should this behavior apply only when the menu items will have unique labels?

Acceptance criteria (or Done)

  • When the text of the Lookup exactly matches the label of one of the Menu items, it is selected by automatically on blur.
  • If there are multiple menu items that match the text, the menu item is not automatically selected on blur.

Future tasks

Event Timeline

@bmartinezcalvo if we really think this should apply to Combobox as well, I think that should be a separate task.

CCiufo-WMF triaged this task as Medium priority.Oct 7 2024, 4:23 PM
CCiufo-WMF set the point value for this task to 3.

The example from T362720#10291006 made me wonder if in addition to selecting the menu item on blur, we should focus the menu item on keystroke so that you can press Enter to select the menu item if what you've typed into the input matches exactly.

The example from T362720#10291006 made me wonder if in addition to selecting the menu item on blur, we should focus the menu item on keystroke so that you can press Enter to select the menu item if what you've typed into the input matches exactly.

We could do the following:

  1. In case the text typed matches exactly with one of the results from the menu, this menu item could be automatically focused so you can press Enter and select that menu item.
  2. In case the matched result is focused and the user clicks outside the Lookup, that focused result could be automatically selected.

Captura de pantalla 2024-11-07 a las 12.32.37.png (604×2 px, 104 KB)

We will need to check if this is possible from a technical perspective.