القائمة وMenubar وزر القائمة
نفّذوا قوائم التطبيقات بالأدوار والمفاتيح الصحيحة
القائمة وMenubar وزر القائمة درس مجاني في Web Accessibility Academy على CoddyKit. هذا هو الدرس 3 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Web Accessibility Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Web Accessibility Academy 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
What ARIA Menus Are
An ARIA menu is an app-style list of commands, like the File or Edit menus in desktop software, not your site's main navigation. 🍔
Not for Site Navigation
Page links belong in a nav with normal anchors. Use the menu role only for true command sets, or you will confuse screen reader users.
Three Core Roles
The pattern uses role="menu" for the container, role="menuitem" for each command, and role="menubar" for a horizontal always-visible bar.
<ul role="menu">
<li role="menuitem">Cut</li>
<li role="menuitem">Copy</li>
</ul>The Menu Button
A menu button is a real button that opens a menu. Give it aria-haspopup="true" so users know a popup is coming.
<button aria-haspopup="true"
aria-expanded="false">Actions</button>Track Open State
The menu button toggles aria-expanded between true and false as its menu opens and closes, just like any disclosure control.
Move Focus on Open
When the menu opens, move focus into it, onto the first menu item. The button no longer holds focus while the menu is active.
Arrow Keys Inside
Inside a vertical menu, Up and Down Arrow move between items. In a menubar, Left and Right Arrow move along the top-level bar.
Roving tabindex
Only one menu item is in the tab order at a time. With roving tabindex, the focused item has tabindex 0 and the rest have -1.
Activate and Close
Enter or Space runs the focused command and closes the menu. The menu should dismiss itself after a command is chosen.
Escape Returns Focus
Escape closes the menu without acting and sends focus back to the menu button, so the user lands exactly where they started.
Submenus Need More
A flyout submenu uses aria-haspopup on its parent menuitem, and Right Arrow opens it while Left Arrow closes it and returns.
Quick Check
You add a button that opens a list of commands. What signals to assistive tech that a menu will appear?
Recap
Menus are for commands, not page links: open with a haspopup button, move focus in, navigate with arrows and roving tabindex, and let Escape return focus. ✅
الأسئلة الشائعة
هل درس «القائمة وMenubar وزر القائمة» مجاني؟
نعم — نص درس «القائمة وMenubar وزر القائمة» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Web Accessibility Academy، انتقل إلى CoddyKit PRO. تتضمن دورة Web Accessibility Academy 4 دروس في المجموع.
ماذا ستتعلم في «القائمة وMenubar وزر القائمة»؟
نفّذوا قوائم التطبيقات بالأدوار والمفاتيح الصحيحة تتمرن على Web Accessibility Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ Web Accessibility Academy؟
لا تُشترط خبرة سابقة. Web Accessibility Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 3 من أصل 4.
كم من الوقت يستغرق درس «القائمة وMenubar وزر القائمة»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس Web Accessibility Academy هذا؟
نعم. كل درس في Web Accessibility Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- قراءة APG: الأنماط والمفاتيح والأمثلة
- إتقان Combobox والإكمال التلقائي
- القائمة وMenubar وزر القائمة
- Treegrid والأنماط المتقدمة الأخرى