```
This is markup for an example, not the complete application logic. Use showModal() to open a native modal dialog, handle the result, and perform deletion only after the confirmed action. The description of deletion must match what your system actually does.
## Choose initial focus deliberately
For a destructive action, a safe initial focus may be the cancel control. For a long informational dialog, focusing the beginning of the content may help. The correct choice depends on the task; do not always focus the first input just because it exists.
## Test opening and closing
- Open with the keyboard and inspect initial focus.
- Tab forward and backward through the dialog.
- Close with the intended cancel or Escape path.
- Check focus returns to the trigger, or a sensible replacement if it disappeared.
- Confirm background content is not accidentally interactive while modal.
Motion around the dialog should not delay focus or prevent cancellation. Provide a reduced-motion path if it slides or scales. Test the complete component in your target browsers and assistive technologies; a copied fragment does not establish that your implementation follows the full modal pattern.
---
SkillStall · 2026-10-02
W3C WAI: Modal dialog pattern: https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/