Fix an issue where clicking on an empty textbox like fill factor or comments, considers it as change and enabled the save button. Fixes #4506.

This commit is contained in:
Aditya Toshniwal
2019-12-11 14:35:14 +05:30
committed by Akshay Joshi
parent 43d37e3b4c
commit 11bf5fc679
6 changed files with 13 additions and 7 deletions

View File

@@ -367,7 +367,8 @@ define([
return;
}
attrs[k] = v;
if (_.isEqual(self.origSessAttrs[k], v)) {
/* If the orig value was null and new one is empty string, then its a "no change" */
if (_.isEqual(self.origSessAttrs[k], v) || (self.origSessAttrs[k] === null && v === '')) {
delete self.sessAttrs[k];
} else {
self.sessAttrs[k] = v;
@@ -738,9 +739,7 @@ define([
field = this.fieldData[keys[i]];
msg = null;
if (!(_.isUndefined(value) || _.isNull(value) ||
String(value).replace(/^\s+|\s+$/g, '') == '')) {
if (!(_.isUndefined(value) || _.isNull(value) || String(value) === '')) {
if (!field) {
continue;
}