Frontend & browser·Accessibility and semantics
tabbing inside the modal cycles through its controls and never reaches the page behind it.
Focus trap
Also calledfocus containment
Confining keyboard focus to a subtree while a modal interaction is open, cycling from the last element back to the first. It is required for a modal dialog, because focus reaching the obscured page behind is disorienting and unrecoverable. A trap without an escape route is worse than none, which is why a modal must always close on Escape.