Focus Management
Gestione del focus
La gestione del focus sposta il punto attivo della tastiera dopo che la pagina cambia. Restituisce anche il focus quando una superficie temporanea si chiude.
trigger -> place focus -> finish or close -> restore to a sensible target#edit-profile#display-nameEntertrigger -> place focus -> finish or close -> restore to a sensible targetA11YUn altro esempio
Una persona apre Modifica profilo. Il focus entra nella finestra di dialogo. Dopo che Salva la chiude, il focus ritorna a Modifica profilo.
Parti principali
- 01Controllo di attivazione
- 02Schermo o cambiamento del DOM
- 03Obiettivo di focalizzazione iniziale
- 04tracciamento elemento attivo
- 05Evento di chiusura o completamento
- 06Ritorno o destinazione di fallback
Usalo quando
Usalo dopo aver aperto o chiuso un dialogo, cancellato un elemento o modificato un percorso. Scegli prima il prossimo obiettivo utile.
Non usarlo quando
Non spostare il focus per ogni piccolo aggiornamento. Salti imprevisti possono far perdere il posto agli utenti che usano tastiera e lettore di schermo.
Nome usato nel codice
trigger -> place focus -> finish or close -> restore to a sensible target Prima di spedire
Give assistive tools the control’s name (accessible name), purpose (role), value, and state. Check keyboard use, visible focus, target size, disabled and busy states, feedback, and recovery.
Outcome: Complete the task with Gestione del focus (Focus Management). User context: Una persona apre Modifica profilo. Il focus entra nella finestra di dialogo. Dopo che Salva la chiude, il focus ritorna a Modifica profilo. Recommended pattern: Gestione del focus (Focus Management). Why it fits: Usalo dopo aver aperto o chiuso un dialogo, cancellato un elemento o modificato un percorso. Scegli prima il prossimo obiettivo utile. Do not use it when: Non spostare il focus per ogni piccolo aggiornamento. Salti imprevisti possono far perdere il posto agli utenti che usano tastiera e lettore di schermo. 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): È ufficiale per quella fonte. Altre piattaforme o team potrebbero usare il termine in modo diverso. Unknowns to confirm: Product wording, data source, analytics events, supported devices and languages, and platform limits.
Controlla questa richiesta
Review how Gestione del focus (Focus Management) is used now. Definition: La gestione del focus sposta il punto attivo della tastiera dopo che la pagina cambia. Restituisce anche il focus quando una superficie temporanea si chiude. Release checks: Give assistive tools the control’s name (accessible name), purpose (role), value, and state. Check keyboard use, visible focus, target size, disabled and busy states, feedback, and recovery. Before changing code, list the evidence, gaps, severity, and the smallest safe fix.