๐ŸŽฎ Native <dialog> in action

Open a modal, try closing it three ways, and watch what returnValue captures. No libraries. No focus-trap code. No Escape handler.

1 Configure the backdrop
dialog::backdrop
2 Open the dialog

Modal blocks the rest of the page โ€” Tab stays inside, Escape closes it, the backdrop appears.
Non-modal is just visible โ€” you can still click outside and Tab freely.

3 Close result
returnValue โ†’ โ€”
closed via โ†’ โ€”
Events will appear here as you interact with the dialogโ€ฆ

Are you sure?

This confirms a delete. Try closing with the buttons below, pressing Escape, or clicking the backdrop. Check what returnValue captures each way.