Chuyển đến nội dung
Skillpedia
Website và giao diện (frontend)75k · #2736

aria-required-parent

Skill này làm gì

Skill này kiểm tra các phần tử có vai trò ARIA nhất định có nằm trong vai trò cha mà chúng cần hay không. Nó dành cho lập trình viên làm menu, tab, danh sách hoặc các widget tùy chỉnh khác.

Khi nào nên dùng

  • ✓Khi bạn làm menu, bộ tab hoặc danh sách từ phần tử tùy chỉnh.
  • ✓Khi trình đọc màn hình không nhóm các mục lại với nhau.
  • ✓Khi bạn xem lại thành phần dùng vai trò listitem, tab hoặc menuitem.

Liên kết skill

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/aria-required-parent/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/aria-required-parent/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Kiểm tra các mục menu của tôi có nằm trong phần tử menu để trình đọc màn hình đọc chúng như một nhóm không.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent tìm các mục có vai trò yêu cầu cha, rồi bọc chúng trong vai trò container đúng, hoặc chuyển chúng đến đúng vị trí trong đánh dấu.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Ensure ARIA roles are contained by required parent roles

If an ARIA child role (like a menu item) is not contained within its required parent role (like a menu), screen readers may fail to announce the item as part of a group, breaking navigation.

Quick Reference

  • Certain roles (like listitem) must be owned by specific parent roles (like list)
  • Ensure children elements are not orphaned from their semantic containers
  • Maintain valid ARIA hierarchies for menu items, tabs, and list items

Check

Verify that elements with roles like listitem, tab, or menuitem are correctly nested within their required parent roles.

Fix

Wrap elements with roles that require a specific parent in the appropriate container role (e.g., wrap role="listitem" in role="list").

Explain

Explain why certain ARIA roles must be nested within specific parent containers to maintain semantic meaning and group navigation.

Code Review

Review the rendered markup and interactive states that affect Ensure ARIA roles are contained by required parent roles. Flag exact elements, roles, labels, focus behavior, or keyboard interactions that violate the rule, and note how to verify the fix with browser accessibility tooling or assistive tech.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/accessibility/aria-required-parent

Câu hỏi thường gặp

Điều gì xảy ra khi một mục menu không có cha menu?

Skill nói trình đọc màn hình có thể không thông báo mục như một phần của nhóm, làm hỏng việc điều hướng.

Skill nêu những vai trò nào làm ví dụ?

Nó nêu listitem trong list, tab trong tablist và menuitem trong menu.

Tôi sửa thế nào?

Bọc mục trong vai trò container phù hợp, như danh sách bao quanh các mục danh sách.

Chi tiết

Mô tả gốc của tác giả

Use when reviewing rendered HTML, interactive components, or design-system patterns related to Ensure ARIA roles are contained by required parent roles. Check native semantics first, then inspect keyboard behavior, focus flow, accessible names, and screen-reader output where relevant.

repo: thedaviddias/Front-End-Checklist

Độ phổ biến

Sao GitHub
75k
Vị trí xếp hạng
#2736
Giấy phép
MIT
Cập nhật
31/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự