FA-8141 / Autocomplete interactions / Open access
Combobox keyboard commit: Tab unexpectedly commits an unconfirmed suggestion · case 01
Tab unexpectedly commits an unconfirmed suggestion.
ROOT CAUSE
The tab operation uses `if key == 'Tab': return (active, query, False)` where the contract requires `if key == 'Tab': return (value, query, False)`.
VERIFIED REPAIR
Implement the tab operation as `if key == 'Tab': return (value, query, False)`.
Unsuccessful approach: Keeping the popup open leaves an orphaned overlay after focus moves.
Case contract
Escape discards query but preserves committed value; Enter commits only an existing active option in an open popup; Tab closes without commit; Clear resets both; typing opens suggestions.
Why this case matters
A deterministic model of combobox keyboard commit; this isolates one interface invariant without requiring a browser.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(options, active, value, query, opened, key):
if key == 'Escape': return (value, '', False)
if key == 'Enter' and opened and active in options: return (active, query, False)
if key == 'Tab': return (active, query, False)
if key == 'Clear': return (None, '', opened)
if key == 'Input': return (value, query, True)
return (value, query, opened)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('escape', solve(['a','b'], 'b', 'a', 'b', True, 'Escape'), ('a', '', False))
check('closed enter', solve(['a','b'], 'b', 'a', 'b', False, 'Enter'), ('a', 'b', False))
check('removed active', solve(['a'], 'b', 'a', 'b', True, 'Enter'), ('a', 'b', True))
check('commit', solve(['a','b'], 'b', 'a', 'b', True, 'Enter'), ('b', 'b', False))
check('tab', solve(['a','b'], 'b', 'a', 'b', True, 'Tab'), ('a', 'b', False))
check('clear', solve(['a'], 'a', 'a', 'a', True, 'Clear'), (None, '', True))
check('typing', solve(['a'], 'a', 'a', 'b', False, 'Input'), ('a', 'b', True))
check('parameterized suggestion', solve(list(range(N+1)), N, 0, str(N), True, 'Enter'), (N,str(N),False))
for repetition in range(N):
check('repeat typing', solve(['a'], 'a', 'a', 'b', False, 'Input'), ('a', 'b', True))
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| escape | ['a', '', False] | ['a', '', False] | Passed |
| closed enter | ['a', 'b', False] | ['a', 'b', False] | Passed |
| removed active | ['a', 'b', True] | ['a', 'b', True] | Passed |
| commit | ['b', 'b', False] | ['b', 'b', False] | Passed |
| tab | ['b', 'b', False] | ['a', 'b', False] | Failed |
| clear | [None, '', True] | [None, '', True] | Passed |
| typing | ['a', 'b', True] | ['a', 'b', True] | Passed |
| parameterized suggestion | [1, '1', False] | [1, '1', False] | Passed |
| repeat typing | ['a', 'b', True] | ['a', 'b', True] | Passed |
SHA-256 / 06689f2a350ae4b68d7a36b9ecb72894e1cb969292624cf8ffa19d0b046d54fa
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(options, active, value, query, opened, key):
if key == 'Escape': return (value, '', False)
if key == 'Enter' and opened and active in options: return (active, query, False)
if key == 'Tab': return (value, query, True)
if key == 'Clear': return (None, '', opened)
if key == 'Input': return (value, query, True)
return (value, query, opened)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('escape', solve(['a','b'], 'b', 'a', 'b', True, 'Escape'), ('a', '', False))
check('closed enter', solve(['a','b'], 'b', 'a', 'b', False, 'Enter'), ('a', 'b', False))
check('removed active', solve(['a'], 'b', 'a', 'b', True, 'Enter'), ('a', 'b', True))
check('commit', solve(['a','b'], 'b', 'a', 'b', True, 'Enter'), ('b', 'b', False))
check('tab', solve(['a','b'], 'b', 'a', 'b', True, 'Tab'), ('a', 'b', False))
check('clear', solve(['a'], 'a', 'a', 'a', True, 'Clear'), (None, '', True))
check('typing', solve(['a'], 'a', 'a', 'b', False, 'Input'), ('a', 'b', True))
check('parameterized suggestion', solve(list(range(N+1)), N, 0, str(N), True, 'Enter'), (N,str(N),False))
for repetition in range(N):
check('repeat typing', solve(['a'], 'a', 'a', 'b', False, 'Input'), ('a', 'b', True))
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| escape | ['a', '', False] | ['a', '', False] | Passed |
| closed enter | ['a', 'b', False] | ['a', 'b', False] | Passed |
| removed active | ['a', 'b', True] | ['a', 'b', True] | Passed |
| commit | ['b', 'b', False] | ['b', 'b', False] | Passed |
| tab | ['a', 'b', True] | ['a', 'b', False] | Failed |
| clear | [None, '', True] | [None, '', True] | Passed |
| typing | ['a', 'b', True] | ['a', 'b', True] | Passed |
| parameterized suggestion | [1, '1', False] | [1, '1', False] | Passed |
| repeat typing | ['a', 'b', True] | ['a', 'b', True] | Passed |
SHA-256 / cc9711c337166de82d16ba215034b5b40ef31ac8abc4264bdd6f8b863bb7552d
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(options, active, value, query, opened, key):
if key == 'Escape': return (value, '', False)
if key == 'Enter' and opened and active in options: return (active, query, False)
if key == 'Tab': return (value, query, False)
if key == 'Clear': return (None, '', opened)
if key == 'Input': return (value, query, True)
return (value, query, opened)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('escape', solve(['a','b'], 'b', 'a', 'b', True, 'Escape'), ('a', '', False))
check('closed enter', solve(['a','b'], 'b', 'a', 'b', False, 'Enter'), ('a', 'b', False))
check('removed active', solve(['a'], 'b', 'a', 'b', True, 'Enter'), ('a', 'b', True))
check('commit', solve(['a','b'], 'b', 'a', 'b', True, 'Enter'), ('b', 'b', False))
check('tab', solve(['a','b'], 'b', 'a', 'b', True, 'Tab'), ('a', 'b', False))
check('clear', solve(['a'], 'a', 'a', 'a', True, 'Clear'), (None, '', True))
check('typing', solve(['a'], 'a', 'a', 'b', False, 'Input'), ('a', 'b', True))
check('parameterized suggestion', solve(list(range(N+1)), N, 0, str(N), True, 'Enter'), (N,str(N),False))
for repetition in range(N):
check('repeat typing', solve(['a'], 'a', 'a', 'b', False, 'Input'), ('a', 'b', True))
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| escape | ['a', '', False] | ['a', '', False] | Passed |
| closed enter | ['a', 'b', False] | ['a', 'b', False] | Passed |
| removed active | ['a', 'b', True] | ['a', 'b', True] | Passed |
| commit | ['b', 'b', False] | ['b', 'b', False] | Passed |
| tab | ['a', 'b', False] | ['a', 'b', False] | Passed |
| clear | [None, '', True] | [None, '', True] | Passed |
| typing | ['a', 'b', True] | ['a', 'b', True] | Passed |
| parameterized suggestion | [1, '1', False] | [1, '1', False] | Passed |
| repeat typing | ['a', 'b', True] | ['a', 'b', True] | Passed |
SHA-256 / 27fd573a100cd9f334d842986b2fda43037577f50f135b310d544acb9f6e7cab
Verification & scope
This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:38:18.754956+00:00.
Case digest / 6bd5c5ed13c70a0474ea1c828b41ed151c316ed40fbf77656ba7b3e6b59ffe30