Keyboard Trap
Trappola della tastiera
Una trappola da tastiera si verifica quando il focus entra in una parte della pagina ma non può uscirne tramite tastiera.
Un altro esempio
Un viaggiatore apre un selezionatore di date. Può spostarsi tra le date, premere Escape per chiuderlo o premere Tab dopo aver scelto. Un calendario rotto cattura ogni pressione di Tab e non offre via d'uscita.
Parti principali
- 01Percorso di ingresso
- 02operazione interna
- 03Uscita documentata
Usalo quando
Testa ogni widget complesso, overlay, editor incorporato e frame di terze parti usando solo la tastiera. Assicurati che le persone possano entrare e uscire.
Non usarlo quando
Un ciclo di focus in un modal non è una trappola quando il tasto Escape e un pulsante di chiusura visibile permettono sempre alle persone di uscire.
Nome usato nel codice
keyboard-only test: enter, operate, Escape or Tab out Prima di spedire
Before release, check the page structure, keyboard access, visible focus, contrast, and zoom. Also check loading, empty, error, success, cancel, and reduced-motion states.
Outcome: Complete the task with Trappola della tastiera (Keyboard Trap). User context: Un viaggiatore apre un selezionatore di date. Può spostarsi tra le date, premere Escape per chiuderlo o premere Tab dopo aver scelto. Un calendario rotto cattura ogni pressione di Tab e non offre via d'uscita. Recommended pattern: Trappola della tastiera (Keyboard Trap). Why it fits: Testa ogni widget complesso, overlay, editor incorporato e frame di terze parti usando solo la tastiera. Assicurati che le persone possano entrare e uscire. Do not use it when: Un ciclo di focus in un modal non è una trappola quando il tasto Escape e un pulsante di chiusura visibile permettono sempre alle persone di uscire. Product requirements: Define the default, loading, empty, error, success, and recovery states. Keep user input. Give clear feedback after every action. Accessibility and resilience: Use semantic HTML, full keyboard access, and visible focus. Make the layout work when zoomed and support reduced motion. Follow the project’s current rules. Do not add a new UI library unless the project already uses it. Acceptance criteria: The main task works with keyboard only and at 320px width. Focus and status changes are announced. Check loading, failure, retry, cancel, and reduced-motion paths. Evidence and limits (evidence boundary): Lo standard copre solo l'ambito elencato. Non sceglie lo stile visivo, la decisione sul prodotto o l'esempio di vocabolario. Unknowns to confirm: Product wording, data source, analytics events, supported devices and languages, and platform limits.
Controlla questa richiesta
Review how Trappola della tastiera (Keyboard Trap) is used now. Definition: Una trappola da tastiera si verifica quando il focus entra in una parte della pagina ma non può uscirne tramite tastiera. Release checks: Before release, check the page structure, keyboard access, visible focus, contrast, and zoom. Also check loading, empty, error, success, cancel, and reduced-motion states. Before changing code, list the evidence, gaps, severity, and the smallest safe fix.