[feat]: add `aria-orientation` support to `TabsAriaController`
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 1-2 天
- 新手友好度
- 57/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
Start with core/pfe-core/controllers/tabs-aria-controller.ts and trace how pf-v5-tabs supplies its tablist and vertical state, then check how RovingTabindexController reads orientation. Implementing this spans controller ownership, component wiring, runtime orientation changes, and SSR behavior; the issue names controller tests as the place to cover horizontal, vertical, and switching orientation. Done when the tablist exposes the correct orientation and keyboard navigation follows it.
由索引模型根据 Issue 内容生成。
描述
Summary
TabsAriaController does not set aria-orientation on the tablist, and nothing wires a tabs element's vertical/horizontal state into the accessibility tree.
Current state
TabsAriaController (core/pfe-core/controllers/tabs-aria-controller.ts) only:
- sets
role="tab"androle="tabpanel"on slotted children - sets
aria-controlsandaria-labelledbyinhostUpdated()
It never touches the tablist itself. In pf-v5-tabs, the tablist is an inner <div id="tabs" role="tablist"> with no aria-orientation, while the element has a vertical boolean that only drives styling.
// tabs-aria-controller.ts
hostUpdated(): void {
for (const [tab, panel] of this.#tabPanelMap) {
panel.setAttribute('aria-labelledby', tab.id);
tab.setAttribute('aria-controls', panel.id);
}
}
Problems
-
Missing ARIA state. A vertical tablist has no
aria-orientation="vertical", so assistive tech reports the wrong orientation. Per the ARIA spec,aria-orientationdefaults tohorizontalontablist, so a vertical tablist is actively announced incorrectly. -
Keyboard behavior is not orientation-aware.
ATFocusController.onKeydownreadsaria-orientationfrom the items container to decide which arrow keys move focus:const orientation = this.options.getOrientation?.() ?? this .#itemsContainerElement ?.getAttribute('aria-orientation') as 'horizontal' | 'vertical' | 'grid' | 'undefined';Because the tablist never has the attribute and
pf-v5-tabsdoes not passgetOrientationtoRovingTabindexController, both Left/Right and Up/Down move focus in a horizontal tablist. The APG tabs pattern expects Left/Right for horizontal tablists and Up/Down for vertical ones. -
Duplicated ownership.
role="tablist"is hardcoded in thepf-v5-tabsrender while the rest of the tabs ARIA is managed by the controller. This split makes it easy for one side to drift from the other.
Proposed direction
- Add tablist ARIA management to
TabsAriaController, includingaria-orientation. - Accept an orientation source in
TabsAriaControllerOptions, for exampleorientation?: 'horizontal' | 'vertical'orgetOrientation?: () => 'horizontal' | 'vertical', and reflect it toaria-orientationon the tablist (omit the attribute for the horizontal default, or set it explicitly, whichever the team prefers). - Give the controller a way to reference the tablist element. Since the host is not the tablist in
pf-v5-tabs, this likely needs an option such asgetTabList?: () => HTMLElement | null, or a documented contract that the host itself carriesrole="tablist". - Feed the same orientation to
RovingTabindexControllerviagetOrientation, or rely on the attribute once the controller sets it on the items container. - Consider moving
role="tablist"ownership into the controller as part of this change. - Keep the SSR path safe (
isServerguard) and add controller tests covering horizontal, vertical, and switching orientation at runtime.
Impacted components
core/pfe-core/controllers/tabs-aria-controller.tselements/pf-v5-tabs<pf-v6-tabs>implementation in #3040
Related issues
- #3040
Jira Issue: FELT-5230
- 主要语言
- TypeScript
- 星标
- 397
- 派生
- 109
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
patternfly/patternfly-elements 的其他 Issue
-
[feat]: support non-element `ReactiveControllerHost` in pfe-core controllers可能重新可做 @bennypowers 于 30 天前认领,目前没有进行中的 PR。 未关闭breaking change feature needs discussion
patternfly/patternfly-elements#3166 · 已指派 1 人 ·
-
[bug] ssr-shims.js uses deprecated globalThis.litSsrCallConnectedCallback可能已有人在做 @zeroedin 于 106 天前认领。 未关闭bug
patternfly/patternfly-elements#3158 · 已指派 1 人 ·
-
chore: evaluate removing isolatedDeclarations from tsconfig可能重新可做 @bennypowers 于 196 天前认领,目前没有进行中的 PR。 未关闭
patternfly/patternfly-elements#3136 · 1 条评论 · 已指派 1 人 ·
-
chore: update docs scaffolding for v6 elements可能重新可做 @zeroedin 于 196 天前认领,目前没有进行中的 PR。 未关闭docs
patternfly/patternfly-elements#3131 · 已指派 1 人 ·
-
难度 4/5 3-5 天 新手友好度 55/100
patternfly/patternfly-elements#3122 ·
查看 patternfly/patternfly-elements 的全部 Issue
相似的 Issue
-
[Site] Active section detection should respect scroll-margin-top可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭area/web reproduced type/bug
难度 2/5 1-3 小时 新手友好度 65/100
anomalyco/opencode#65384 · 1 条评论 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
swc-project/swc-ai-issues#1001 ·
-
check:passed streams:add
难度 1/5 1 小时以内 新手友好度 62/100
维护者通常 1 天内回复
-
fix(table): CollapseColumn uses wrong caret icon for expandable row toggle可能已有人在做 @redhat-chai-bot 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 85/100
patternfly/patternfly-react#12727 ·
维护者通常 1 天内回复
-
CLI OAuth login fails behind an authenticating proxy: GET /api/v1/user omits Proxy-Authorization未关闭
难度 1/5 1 小时以内 新手友好度 85/100
lightdash/lightdash#33086 · 1 条评论 ·
维护者通常 1 天内回复