Saltar al contenido principal

Walk a Modal's Focus Path

Apply focus-management decisions for an accessible modal dialog.

frontend-development5 min read

Focus risk You own a delete-account modal with two buttons: Cancel and Delete account. The overlay appears visually, but the DOM behind it remains full of links and controls. The principle is predictable keyboard focus: users should not have to guess where their active point moved. APG focus path Enter -> Contain -> Return A modal changes the user's interaction mode. Your code must move focus into that mode, keep it there, and put it somewhere logical when the mode ends. Visual only Centering the card but leaving focus behind creates two competing realities. The keyboard path now matches the…

Read the full lesson

Sign up free: one personalized lesson every day, matched to your role and goals.

← Back to library

Contáctanos