Added a "unsaved changed" warning dialog for part, entity edits and system settings

This fixes issue #1368
This commit is contained in:
Jan Böhmer 2026-05-25 21:29:10 +02:00
parent ad0c60f766
commit 79c36494ea
21 changed files with 556 additions and 11 deletions

View file

@ -83,6 +83,8 @@ export default class TristateCheckbox {
//Do a refresh to set the correct styling of the checkbox
this._refresh();
// Anchor the hidden input's default so dirty-form comparisons have a clean baseline.
this._hiddenInput.defaultValue = this._hiddenInput.value;
this._element.addEventListener('click', this.click.bind(this));
}
@ -202,6 +204,9 @@ export default class TristateCheckbox {
}
this._refresh();
// Notify change listeners (e.g. dirty-form controller) since programmatic
// value changes don't fire native change events.
this._hiddenInput.dispatchEvent(new Event('change', { bubbles: true }));
}
}