New: Cookbooks and AI ExplanationsStep-by-Step recipes to solve problems connected to Roadmaps and Cheat Sheets. Need more details? Use AI buttons for structured and simple explanations with concrete examples throughout the whole platform.Take a look
Tab a few times inside my confirmation modal, and I'm suddenly clicking a button on the page behind it.
What you'll have at the end
A modal where Tab and Shift+Tab cycle only through its own buttons, and Escape returns focus to the trigger
You need
A confirmation modal already rendered through a portal, shown when a piece of state names the project being confirmed, containing a Cancel button and a destructive confirm button, opened by a Delete button in whichever row triggers it.
Not covered
This does not cover styling the overlay, animating the open and close transition, or the native dialog element's own built-in trap, which needs almost none of this, see the variant at the end.
Leans on
Checked 24 Aug 2026
Part of the Web Accessibility cookbook