fix(control): Check if same value is set to avoid unnecessary change trigger

This commit is contained in:
Suraj Shetty 2021-04-22 14:21:05 +05:30
parent 1a30e11b5f
commit 162f191b77
2 changed files with 3 additions and 1 deletions

View file

@ -143,6 +143,7 @@
"Cypress": true,
"cy": true,
"it": true,
"describe": true,
"expect": true,
"context": true,
"before": true,

View file

@ -159,9 +159,10 @@ frappe.ui.form.Control = Class.extend({
},
validate_and_set_in_model: function(value, e) {
var me = this;
if(this.inside_change_event) {
if (this.inside_change_event || this.get_model_value() === value) {
return Promise.resolve();
}
this.inside_change_event = true;
var set = function(value) {
me.inside_change_event = false;