اكتشاف مآزق لوحة المفاتيح
اعثر على المواضع التي يعلق فيها التركيز بلا مخرج.
اكتشاف مآزق لوحة المفاتيح درس مجاني في Web Accessibility Academy على CoddyKit. هذا هو الدرس 4 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Web Accessibility Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Web Accessibility Academy 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
Stuck With No Way Out
A keyboard trap is any spot where focus goes in but cannot get out with the keyboard. For a mouse-free user, it is a dead end. 🪤
Why It Is So Serious
A trapped user may have to reload the whole page just to escape. WCAG calls a no-exit trap a failure, not a minor bug.
The Classic Culprits
Traps love rich widgets: custom date pickers, embedded editors, and third-party plugins that grab focus and never hand it back.
The Broken Modal
A dialog that intercepts Tab but offers no way to leave is the most common trap. A real modal must close on Escape.
Iframes Can Swallow Focus
Embedded content like a video or map sits in an iframe. Some grab focus and leave the user circling inside with no exit.
Bad Event Handlers
Script that calls preventDefault on the Tab key can block the browser's normal move. Suddenly focus simply refuses to advance.
el.addEventListener('keydown', e => e.preventDefault());The One-Way Trap
Some traps let Tab move forward but block Shift+Tab. Test both directions, because a one-way path is still a trap.
Intentional Trapping Is Fine
Holding focus inside an open modal is correct on purpose. The rule is that there must always be a clear exit like Escape or a close button.
How to Find Them
The test is blunt and effective. Tab through the entire page using only the keyboard and never reach for the mouse to escape.
The Telltale Sign
If focus keeps cycling inside one component and Tab will not carry you onward, you have found a trap. Note exactly where it caught you.
Fix the Exit Path
The fix is to restore a way out: let Tab continue, honor Escape, and on close return focus to the trigger that opened the layer.
Quick Check
Identify what truly defines a keyboard trap.
Recap: Spotting Traps
A trap holds focus with no keyboard exit, and it fails WCAG. Tab through everything both ways, and always provide an escape path. ✅
الأسئلة الشائعة
هل درس «اكتشاف مآزق لوحة المفاتيح» مجاني؟
نعم — نص درس «اكتشاف مآزق لوحة المفاتيح» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Web Accessibility Academy، انتقل إلى CoddyKit PRO. تتضمن دورة Web Accessibility Academy 4 دروس في المجموع.
ماذا ستتعلم في «اكتشاف مآزق لوحة المفاتيح»؟
اعثر على المواضع التي يعلق فيها التركيز بلا مخرج. تتمرن على Web Accessibility Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ Web Accessibility Academy؟
لا تُشترط خبرة سابقة. Web Accessibility Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 4 من أصل 4.
كم من الوقت يستغرق درس «اكتشاف مآزق لوحة المفاتيح»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس Web Accessibility Academy هذا؟
نعم. كل درس في Web Accessibility Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- Tab وShift+Tab وEnter وSpace: المفاتيح الأساسية
- تركيز مرئي: لا تخفِ المخطط أبداً
- ترتيب Tab المنطقي يتبع المحتوى
- اكتشاف مآزق لوحة المفاتيح