Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[Bug] Modal hardcodes aria-labelledby and aria-describedby pointing to nonexistent element IDs

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

维护者通常 1 天内回复

@PARTH-TUSSLE 已经在做这个了。

开始于 2026年10月10日。

  • #1868 来自 @PARTH-TUSSLE —— 未关闭

评估

这个 Issue 还没有评估数据。

描述

component/ui kind/bug language/typescript
Current Behavior

In Sistent's Modal component (src/custom/Modal/index.tsx, lines 182–183), the underlying StyledDialog hardcodes:

  • aria-labelledby="alert-dialog-slide-title"
  • aria-describedby="alert-dialog-slide-description"
    However:
  1. The rendered title element (<Typography data-testid="modal-title">{title}</Typography>) does not carry id="alert-dialog-slide-title".
  2. There is no element rendered with id="alert-dialog-slide-description".
  3. Because these IDs are static strings rather than dynamically generated (e.g., via React.useId()), any future attempt to attach static IDs would also produce duplicate-ID DOM collisions when multiple modals exist in the component tree.
  4. Screen readers and automated accessibility audits (e.g., axe, Lighthouse) flag aria-labelledby and aria-describedby referencing nonexistent element IDs.
    Currently, consumers must rely on conditional mounting ({isOpen && <Modal ... />}) as a workaround to avoid tree-level accessibility collisions.
Expected Behavior
  • aria-labelledby should reference the ID of the modal's rendered title component.
  • The ID should be unique per modal instance (using React.useId() or an overridable id / aria-labelledby prop) so multiple dialogs do not collide in the DOM.
  • If no description element is rendered, aria-describedby should not be attached by default unless explicitly supplied by consumer props.
Screenshots/Logs
Environment

Contributor Guides and Resources
主要语言
TypeScript
星标
140
派生
243
平均合并
6 天 23 小时
30 天内合并 PR
13

环境准备

从这里开始

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

layer5io/sistent 的其他 Issue

查看 layer5io/sistent 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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