aria-required-children
ما الذي تفعله
هذه المهارة تفحص أن الأدوات المركّبة، مثل قوائم الألسنة والقوائم والأشجار، تحتوي على العناصر الفرعية الصحيحة. وهي موجهة لمطوري الألسنة والقوائم المخصصة المبنية من عناصر div وspan.
متى تستخدمها
- ✓عندما تبني مجموعة ألسنة أو قائمة أو قائمة اختيار من عناصر div.
- ✓عندما لا يعلن قارئ الشاشة عدد العناصر في قائمة أو قائمة منسدلة.
- ✓عندما تبني قائمة أو تحكمًا أو تنقلًا مخصصًا بدل عناصر HTML الأصلية.
رابط المهارة
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/aria-required-children/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“شريط الألسنة المخصص لدي يستخدم عناصر div عادية. تأكد أن عناصر الألسنة لها الأدوار الصحيحة داخل قائمة الألسنة.”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
يتحقق الوكيل من كل دور حاوية مقابل الأدوار الفرعية التي يجب أن يحتويها، مثل tab داخل tablist، أو listitem داخل list، ويضيف أدوار presentation إلى العناصر الغلافية حيثما لزم.
المحتوى التقني (ملف SKILL.md الأصلي)
النص الأصلي من المؤلف، مباشرة من GitHub.
Ensure ARIA roles contain required child roles
Screen readers like NVDA and VoiceOver navigate composite widgets (menus, tabs, trees) by moving between the required child roles. If a tablist contains <div> elements instead of role='tab', the user hears no tabs at all. JAWS announces 'list of 5 items' only when role='listitem' children exist inside role='list'. Without correct nesting, the entire widget becomes opaque to keyboard-only and screen reader users.
Quick Reference
- Container roles mandate specific owned child roles:
tablist→tab,list/listbox→listitem/option,menu/menubar→menuitem,tree→treeitem,grid/rowgroup→row - Missing required children break the accessibility tree so screen readers cannot enumerate items or announce counts
- Use
role='none'orrole='presentation'on purely structural wrapper elements inside the container to avoid invalid nesting - Applies to WAI-ARIA 1.2 required owned elements for composite widget roles
Check
Identify all elements with ARIA container roles (tablist, list, listbox, menu, menubar, tree, treegrid, grid, rowgroup, radiogroup). For each, verify it contains the required owned child roles per the WAI-ARIA spec: tablist must own tab elements; list must own listitem; listbox must own option; menu/menubar must own menuitem, menuitemcheckbox, or menuitemradio; tree must own treeitem; grid must own row (which owns gridcell); radiogroup must own radio. Flag any container roles missing required children.
Fix
For each container role missing its required children: (1) Add the correct role to each child element — e.g., add role='tab' to each tab button inside role='tablist'. (2) If wrapper <div> elements exist between the container and the required children for layout purposes, add role='none' or role='presentation' to those wrappers. (3) Prefer native HTML equivalents where possible: <ul>/<li> instead of role='list'/role='listitem', <select>/<option> instead of role='listbox'/role='option'.
Explain
WAI-ARIA 1.2 defines 'required owned elements' for composite widget roles — these are the child roles a container must contain for the widget to be valid. Screen readers build their understanding of a widget from this structure. A tablist without tab children means a screen reader user in Forms Mode will find nothing to navigate between. A menu without menuitem children will not be announced as a menu at all in some ATs. This is distinct from aria-required-parent, which checks the inverse direction.
Code Review
Review the rendered markup and interactive states that affect Ensure ARIA roles contain required child 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-children
الأسئلة الشائعة
ماذا يحدث إذا غابت الأدوار الفرعية؟
تنص المهارة على أن قارئ الشاشة قد لا يعلن العناصر أو عددها، وهذا يكسر التنقل.
ما دور none؟
يُستخدم لوضع علامة على الأغلفة البنيوية البحتة حتى لا تكسر البنية المطلوبة.
ما الأدوار التي تذكرها المهارة كأمثلة؟
تذكر tab داخل tablist، وlistitem داخل list، وoption داخل listbox، وmenuitem داخل menu.
التفاصيل
الوصف الأصلي من المؤلف
Use when applies to custom ARIA widgets using composite roles: tablist, list, listbox, menu, menubar, tree, treegrid, grid, rowgroup, row, radiogroup. Use when reviewing components built with div/span elements that replace native HTML list, select, or nav elements.
الشعبية
- نجوم GitHub
- 75k
- الترتيب
- #2735
- الترخيص
- MIT
- آخر تحديث
- 31/10/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
frontendchecklist
75kيفحص شيفرة الواجهة الأمامية والصفحات الحية مقابل أكثر من 380 قاعدة للوصول وسرعة الأداء وتحسين محركات البحث والأمان، بأداة سطر أوامر.
frontend-checklist-global
75kيدقق مشروع الواجهة الأمامية وفق كل قواعد Front-End Checklist البالغ عددها 386، ويقدم إصلاحًا محددًا لكل مشكلة وجدت.
404-page
75kيتأكد من أن صفحة الصفحات غير الموجودة تقدم روابط مفيدة وتُرجع رمز حالة 404 حقيقيًا، لمساعدة الزوار التائهين على إيجاد طريقهم.
about-page
75kيراجع ما إذا كان لموقعك صفحة «من نحن» واضحة تشرح من يديره، لبناء الثقة لدى الزوار ومحركات البحث.
مهارات مشابهة
angular-developer
280kيساعد وكيلك على كتابة شيفرة Angular وتقديم نصائح لبنية المشروع، ويفيد في بدء المشاريع الجديدة وإنشاء المكونات وتحسين الأداء وإمكانية الوصول.
frontend-a11y
280kيساعد وكيلك على جعل واجهات الويب متاحة للجميع، فيضمن أن المواقع والتطبيقات تعمل جيدًا مع قارئات الشاشة والتنقل بلوحة المفاتيح.
frontend-patterns
280kيطبّق وكيلك أنماط تطوير الواجهات الحديثة، فيحسّن الأداء ويدير الحالة ويتبع أفضل الممارسات في React وNext.js.