Modal dialog and focus restoration

GUI95

Widget index / Windows and dialogs · Download this HTML

Rename document

Ready — try the example.

States and behavior

Closed/open modal, default action, validation, cancellation, inert background and restored focus.

Keyboard

Tab stays within the native dialog; Enter submits the field; Escape cancels; closing returns focus to Rename document.

Scope and adaptation

Native HTML dialog supplies browser modality. Electron caption buttons and other native host windows require separate coordination; CSS cannot block host window controls.

Sources

Microsoft preliminary guide (1995), chapters 7–8 · Modern browser accessibility pattern

Original implementation; system colors are represented by CSS variables. The default 13 px system-font stack is a readable browser adaptation. The 1995 source is preliminary, not a final product specification. Test the target browser and native host before shipping.