Skip to content

[combobox] Document and improve input click + list options filtering#3449

Open
silviuaavram wants to merge 1 commit into
w3c:mainfrom
silviuaavram:feat/improve-combobox-guidance
Open

[combobox] Document and improve input click + list options filtering#3449
silviuaavram wants to merge 1 commit into
w3c:mainfrom
silviuaavram:feat/improve-combobox-guidance

Conversation

@silviuaavram

@silviuaavram silviuaavram commented Jun 15, 2026

Copy link
Copy Markdown

Closes #3442.

Implements what we discussed in this comment.

Improve combobox click, focus, and filter guidance

Changes

Behavior (combobox-autocomplete.js)

  • Show all options when the trimmed input value is empty or exactly matches an option (case-insensitive); filter otherwise.

Pattern documentation (combobox-pattern.html)

  • Replace "focus opens popup" with "click opens popup but does not toggle it closed".
  • Add bullet for the chevron/toggle button, which toggles the popup open or closed.
  • Extend filtering description to clarify trimmed-value and exact-match behavior.

Example pages (combobox-autocomplete-{both,list,none}.html)

  • Add textbox-filter row to the keyboard table (list/both examples) documenting filter and show-all conditions.
  • Add new Pointer Interaction section with separate Textbox and Button subsections covering click, focus, and toggle behaviors.

Regression tests (combobox_autocomplete-{both,list,none}.js)

  • textbox-click: clicking the input opens the popup and a second click does not close it.
  • textbox-focus: focusing the input without clicking does not open the popup.
  • textbox-filter (list/both): verifies all options shown for empty input, exact match, case-insensitive exact match, and whitespace-only input; verifies filtered count (2) for partial string "al".

WAI Preview Link (Last built on Mon, 15 Jun 2026 08:51:49 GMT).

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates the combobox autocomplete examples to refine open/close behavior on pointer interaction and adjust filtering behavior to avoid filtering when the input is empty or already matches an available option.

Changes:

  • Updated ComboboxAutocomplete click handling so repeated textbox clicks don’t toggle the popup closed.
  • Updated filtering logic so empty input (and exact-match input) shows the full option list.
  • Added/updated automated tests and documentation tables describing new pointer/keyboard behaviors; refreshed coverage-report artifacts.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
test/tests/combobox_autocomplete-none.js Adds tests for textbox click/focus pointer interaction behavior.
test/tests/combobox_autocomplete-list.js Adds pointer interaction tests and new filtering-behavior test cases.
test/tests/combobox_autocomplete-both.js Adds pointer interaction tests and new filtering-behavior test cases.
content/patterns/combobox/examples/js/combobox-autocomplete.js Adjusts click-to-open behavior and expands “no filtering” conditions.
content/patterns/combobox/examples/combobox-autocomplete-none.html Documents pointer interaction semantics for textbox/button.
content/patterns/combobox/examples/combobox-autocomplete-list.html Documents pointer interaction + adds keyboard doc row for filtering behavior.
content/patterns/combobox/examples/combobox-autocomplete-both.html Documents pointer interaction + adds keyboard doc row for filtering behavior.
content/patterns/combobox/combobox-pattern.html Updates pattern-level narrative re: filtering and popup opening interactions.
content/about/coverage-and-quality/role-coverage.csv Updates generated counts/entries for role coverage.
content/about/coverage-and-quality/coverage-and-quality-report.html Updates generated role report list (adds a new “note” link).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +196 to +202
if (
this.isNone ||
this.filter.trim() === '' ||
this.allOptions.some(
(opt) => this.getLowercaseContent(opt) === this.filter.toLowerCase()
)
) {
Comment on lines +53 to 55
<li>It is displayed when the user clicks the combobox input. Clicking the input only opens the popup and does not toggle it closed.</li>
<li>If a chevron or toggle button is present adjacent to the combobox, activating it toggles the popup open or closed.</li>
<li>If the combobox is editable, the popup is displayed only if a certain number of characters are typed in the combobox and those characters match some portion of one of the suggested values.</li>
optionsSelector: '#ex1 [role="option"]',
buttonSelector: '#ex1 button',
numAOptions: 5,
numOptions: 56,
optionsSelector: '#ex1 [role="option"]',
buttonSelector: '#ex1 button',
numAOptions: 5,
numOptions: 56,
Comment on lines +199 to +201
this.allOptions.some(
(opt) => this.getLowercaseContent(opt) === this.filter.toLowerCase()
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Guidance for the combobox - input click behavior

2 participants