Skip to content

Query Filter: Add focus-only keyboard type-ahead - #781

Open
jamesbregenzer wants to merge 1 commit into
WordPress:trunkfrom
jamesbregenzer:issue-541-focus-typeahead
Open

jamesbregenzer wants to merge 1 commit into
WordPress:trunkfrom
jamesbregenzer:issue-541-focus-typeahead

Conversation

@jamesbregenzer

Copy link
Copy Markdown

Thanks @StevenDufresne for opening #541 and for the clear native-select behavior to aim for.

Summary

This adds focus-only keyboard type-ahead to the open Query Filter using its existing Interactivity API. Typed label prefixes move focus among enabled options without filtering the list or changing checked state. A short 500 ms prefix window supports multiple characters; repeating a single starting letter cycles through matching options. A miss leaves focus unchanged, and a failed prefix extension starts a fresh search from its latest character.

Escape and the existing Tab focus trap are preserved. Space continues to activate checkboxes and radios natively, and radio arrow-key behavior is unchanged. Modifier shortcuts, IME composition, and editable controls are left alone. This patch does not change Apply/Clear or submission behavior; PR #748's empty-form submission fix remains separate.

Verification

  • Query Filter JavaScript lint, Prettier, and the production build passed.
  • The DOM harness passed red/green acceptance cases and killed a mutation that removed the focus call.
  • Chromium checks passed against WordPress's Interactivity API runtime and a page rendered by the PHP block renderer. An independent rerun passed all 12 PHP-rendered checks with no browser errors.

These checks used local fixtures, not the live production site. The patch was checked against trunk at 3b104f0554e80d7712d90d92e6ac3c46a3716c41 on 2026-10-15.

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.

1 participant