CodeZettaInterview Hub

HTML · Accessibility · Junior · Scenario

How does focus management work for modals?

Short Interview Answer

Move focus into the dialog on open, trap tab within, restore focus on close.

Detailed Explanation

Use dialog element or a vetted pattern. aria-modal and labels required. Background should be inert. Escape closes.

Did you know this answer?