Merge pull request #38548 from KerollesFathy/fix-int-float-dirty-on-input
fix(ui): mark form "Not Saved" on input for Int and Float fields
This commit is contained in:
parent
fa53a971c2
commit
4944dec916
2 changed files with 7 additions and 0 deletions
|
|
@ -185,6 +185,12 @@ frappe.ui.form.ControlData = class ControlData extends frappe.ui.form.ControlInp
|
|||
// debounce to avoid repeated validations on value change
|
||||
this.$input.on("input", frappe.utils.debounce(change_handler, 500));
|
||||
}
|
||||
|
||||
if (this.constructor?.trigger_dirty_on_input_event) {
|
||||
this.$input.on("input", () => {
|
||||
this.frm?.dirty();
|
||||
});
|
||||
}
|
||||
}
|
||||
setup_autoname_check() {
|
||||
if (!this.df.parent) return;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
frappe.ui.form.ControlInt = class ControlInt extends frappe.ui.form.ControlData {
|
||||
static trigger_change_on_input_event = false;
|
||||
static trigger_dirty_on_input_event = true; // mark dirty without reformatting
|
||||
static input_mode = "numeric";
|
||||
make() {
|
||||
super.make();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue