Skip to content

fix(tree-view, listbox): let lowercase a reach typeahead - #3509

Merged
segunadebayo merged 2 commits into
chakra-ui:mainfrom
b84330808:fix/typeahead-lowercase-a
Oct 21, 2026
Merged

segunadebayo merged 2 commits into
chakra-ui:mainfrom
b84330808:fix/typeahead-lowercase-a

Conversation

@b84330808

Copy link
Copy Markdown
Contributor

Closes #3489

📝 Description

In tree-view, the keydown handler has an a entry for the Cmd+A select all shortcut. Without the meta key it returns early, but the dispatcher still stops there because a handler exists, so a plain a never gets to typeahead. This applies the fix suggested in the issue. Listbox has the same pattern with Ctrl/Cmd+A, so I fixed it there too.

⛳️ Current behavior (updates)

Typing a does nothing in a tree view or listbox with typeahead, and any prefix containing a (like abo for "About") doesn't match.

🚀 New behavior

  • The a handler only runs when the select all modifier is pressed (meta for tree-view, ctrl or meta for listbox, the same checks as in the handlers). Otherwise the key goes to typeahead.
  • Cmd+A / Ctrl+A select all still works (the existing e2e tests pass).
  • Added e2e tests: tree-view (a from index.ts focuses app.tsx, pac focuses package.json) and listbox (a from Andorra highlights Afghanistan). They fail on main and pass with the fix.
  • Patch changesets for @zag-js/tree-view and @zag-js/listbox.

💣 Is this a breaking change (Yes/No):

No

📝 Additional Information

  • React e2e for tree-view and listbox: 43 passed, 1 skipped (the existing skipped typeahead test). Typecheck, lint and prettier pass for the touched packages and files.
  • I didn't make before/after screen recordings; the new e2e tests cover the interaction.

I used Claude Code to write this change.

b84330808 and others added 2 commits October 20, 2026 20:45
The keydown handler has an `a` entry for the Cmd+A select all shortcut.
Without the meta key it returned early, but the dispatcher still stopped
there because a handler existed, so a plain `a` never reached typeahead.
Only use that handler when the meta key is pressed.

Closes chakra-ui#3489

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Same problem as in tree-view: the `a` entry for the Ctrl/Cmd+A select all
shortcut caught every lowercase `a`, so typeahead never saw it. Only use
that handler when ctrl or meta is pressed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
zag-nextjs Ready Ready Preview Oct 20, 2026 11:51am UTC
zag-solid Ready Ready Preview Oct 20, 2026 11:51am UTC
zag-svelte Ready Ready Preview Oct 20, 2026 11:51am UTC
zag-vue Ready Ready Preview Oct 20, 2026 11:51am UTC
1 Skipped Deployment
Project Deployment Actions Updated
zag-website Ignored Ignored Preview Oct 20, 2026 11:51am UTC

Request Review

This branch was successfully deployed

4 active deployments
Preview – zag-solid — fe18165c Deployed Oct 20, 2026 by vercel[bot]
Preview – zag-vue — fe18165c Deployed Oct 20, 2026 by vercel[bot]
Preview – zag-svelte — fe18165c Deployed Oct 20, 2026 by vercel[bot]
Preview – zag-nextjs — fe18165c Deployed Oct 20, 2026 by vercel[bot]
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.

Tree view: lowercase a is swallowed instead of reaching typeahead

2 participants