Edit dialog (<dialog> with one form) for an object: one input per property, nested objects flattened
(address.city), the id property (idKey) is not editable.
Works on a deep copy – the object passed in is not changed.
Values keep their type: numbers stay numbers (an empty number field becomes null), booleans are checkboxes
(unchecking saves false), null/undefined stay as they are while their text field is left empty.
Labels and values are escaped – data is shown as text, never as markup.
Save calls onSave(editedCopy); Save, Cancel and Escape close and remove the dialog.
Edit dialog (
<dialog>with one form) for an object: one input per property, nested objects flattened (address.city), the id property (idKey) is not editable.null), booleans are checkboxes (unchecking savesfalse),null/undefinedstay as they are while their text field is left empty.onSave(editedCopy); Save, Cancel and Escape close and remove the dialog.Example