patternfly / patternfly/patternfly-react

Menu/Select/Dropdown - considering refactoring focus logic

未关闭
#11,025 5 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

PF Team Stale
主要语言
TypeScript
星标
862
派生
392
平均合并
4 天 8 小时
30 天内合并 PR
9

描述

Describe the enhancement or change
Following the update that added arrow key handling on menus, we should refactor the logic for when an item is autofocused upon opening via the shouldfocusFirstItemOnOpen prop. Currently it will focus only the first valid item in the menu, but we should tweak it so that:

  • If an item is selected (aria-selected, possibly also if an item with a checkbox is checked), focus should be set on that item (or the first item that matches if multiple are selected).

  • Otherwise focus the first valid item in the menu.

Is this request originating from a Red Hat product team? If so, which ones and is there any sort of deadline for this enhancement?

Any other information?


Jira Issue: PF-11

贡献指南

打开贡献指南

从这里开始

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

调研方向

首先定位与 prop shouldfocusFirstItemOnOpen 相关的 Menu、Select 和 Dropdown 焦点逻辑。跟踪这些组件打开时 aria-selected 和 checked 项是如何表示的。完成标准是:选中项,或第一个匹配的选中项获得焦点;否则由第一个有效项获得焦点,并通过相关测试覆盖现有行为。

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

评估

技术栈
react, typescript
领域
accessibility, frontend
Issue 类型
重构
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 发到你的邮箱

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