Why can I still interact with the page behind the modal?
If the background content is not disabled (e.g., no aria-hidden or inert), users can still click or tab outside the modal. Step 5 shows disabling background interaction is needed.
💡 Always disable background content when modal is open to trap focus and clicks.
Why doesn't keyboard focus move into the modal automatically?
Browsers do not move focus automatically when showing elements. JavaScript must set focus inside the modal as in step 4 to keep keyboard users inside.
💡 Use JavaScript to focus modal container or first focusable element.
Why does the modal overlay cover the whole screen?
The overlay uses position: fixed and inset: 0 to cover the entire viewport, as shown in step 3, creating a dim background that blocks other content visually.
💡 Use fixed positioning and full inset to cover screen with overlay.