Autocomplete: timeline for stable release (and stable virtual-focus API for ListBox)

未关闭
#10,843 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
38/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
react, typescript

调研方向

Start by reading the React Aria Components Autocomplete documentation and the ListBox props, then compare the documented useListBox option shouldUseVirtualFocus with the component API. The issue asks about stabilizing Autocomplete and making virtual focus a supported ListBox prop; done would mean a maintainer decision and, if accepted, a documented stable API. The issue does not name implementation files or tests.

由索引模型根据 Issue 内容生成。

描述

Provide your feedback here.

What's the plan and rough timeline for moving Autocomplete in react-aria-components from RC to stable?

The docs page is tagged rc (#9289), and the underlying @react-aria/autocomplete package is still 3.0.0-rc.x. Our design system has a policy against shipping RC APIs, so we can't use it in production yet.

Related question: SelectableCollectionContext and FieldInputContext are exported from the same Autocomplete module, so we treat them as RC too. Would you consider exposing shouldUseVirtualFocus as a documented prop on RAC ListBox (it's already a documented option of useListBox)? Then a custom search input could drive a ListBox with virtual focus without depending on Autocomplete.

🔦 Context

We have a "search input + suggestions" component built on RAC ListBox (with optional Virtualizer). We want DOM focus to stay on the input while the arrow keys move virtual focus in the list and Enter selects, which is exactly what Autocomplete provides.

Without a stable API, our workaround is:

  • Pass shouldUseVirtualFocus to <ListBox> (not in ListBoxProps; it only works because RAC spreads props into useListBox).
  • Re-dispatch the input's keydown on the listbox element, since useSelectableCollection's keyboard handler ignores events whose target is outside the collection. On Enter, dispatch a click on the focused option.

We'd prefer to drop this in favour of a supported API.

💻 Code Sample
<ListBox ref={listRef} shouldUseVirtualFocus /* undocumented */ items={items}>…</ListBox>

// search input onKeyDown
listRef.current.dispatchEvent(new KeyboardEvent(e.type, e.nativeEvent));
Version

react-aria-components 1.21.0, react-aria 3.52.0, React 19.2

主要语言
TypeScript
星标
16k
派生
1.6k
平均合并
3 天 9 小时
30 天内合并 PR
45

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

adobe/react-spectrum 的其他 Issue

查看 adobe/react-spectrum 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。