top of page

Does Highlighting an Autocomplete Suggestion Mean the Form Has Accepted It?

Oct 26
3 min read

A contributor types the beginning of a project name, moves through autocomplete suggestions and then leaves the field. The visible text looks reasonable, but the submitted record points to a different project or no project at all. The interface has several related states, and the implementation has treated them as though they were one.


For a reliable review, track the typed query, the active suggestion, the accepted display value and the underlying identifier. The exact relationship depends on the chosen combobox behavior. It should never be left to accidental event ordering.


Specify the kind of combobox


The W3C ARIA combobox pattern distinguishes editable controls from select-only controls and describes several autocomplete behaviors. Some allow arbitrary text; others restrict the value to available options.


The listbox pattern uses Enter to accept the focused option. It also describes maintaining DOM focus on the combobox while indicating the active option through aria-activedescendant.


These details matter to implementation, but the product decision comes first: can someone submit a new name, or must they choose an existing project? A field cannot communicate that distinction solely through a dropdown arrow.


Define the accepted value explicitly


Write a small state table in the component specification. For each action—typing, moving among options, accepting, dismissing and leaving the field—record the displayed text and the value that would be submitted.


Do not assume every autocomplete library implements the same selection-on-blur behavior. Choose and document the supported behavior, then test it.


Illustrative example: similar project names


Imagine two options, Cedar Website and Cedar Workshop, with different stable identifiers. A user types Cedar and moves the active highlight to Cedar Workshop. Before accepting it, they dismiss the popup.


The correct remaining value depends on the documented behavior, including whether an earlier selection existed. The important requirement is that the visible field, accessible state and submitted identifier agree with that behavior.


Edit an already selected name


Now select Cedar Website, then change the typed text to Birch. The old Cedar identifier must not silently remain attached to visibly unrelated text. The design might clear the selection and require a new valid choice, or support free text through a distinct representation.


Make that transition observable in the fixture. A test that only chooses an option with a mouse will miss it.


Inspect dismissal and recovery


Use Escape, click outside and move to the next field in separate test cases. Check whether each action preserves, clears or commits the value according to the specification.


If the field requires an existing option, an unmatched query should lead to a useful explanation. Preserve enough context for the person to correct it without restarting the whole form.


When suggestions are unavailable, distinguish “no matching project” from “suggestions could not be loaded.” Neither message should imply a valid selection has been made.


Test the assistive-technology state


Verify that the control has a clear label, its expanded state reflects the popup and the active option reference points to an option that actually exists. Check the selected state against what is visually indicated.


Keyboard editing should remain usable. A custom key handler that captures normal text-editing commands can make an otherwise attractive control difficult to correct.


Use supported browser and screen-reader combinations for the actual component. Reading the pattern and assigning ARIA attributes does not establish that the implementation communicates its states successfully.


Verify the final record


Submit a safe test form and compare its stored identifier with the displayed accepted label. Repeat with similar labels, no matches, an edited selection and a dismissed suggestion. Keep the fixture small enough that a reviewer can predict every expected result.


If suggestions arrive asynchronously, also test a previous query's response arriving after a newer one. The active option must belong to the current result set.


For that timing problem, read stale search responses and the current query. A useful FutureOS brief identifies the exact action after which the visible choice and submitted value diverge.


Editorial note


Editorial note: This article was prepared with AI assistance. Primary sources and the linked FutureOS article inventory were checked on October 26, 2026. Examples are illustrative and are not customer results. The current FutureOS introduction describes the project as being in prelaunch; this guide does not assert that a particular product feature, integration or service is available. The procedures are practical proposals to adapt and test in your own setting. No independent expert review is claimed. Start with a specific question, your relevant constraints and a small example of the result you need.


Comments


Commenting on this post isn't available anymore. Contact the site owner for more info.
bottom of page