From 77a413b66ba73cded9449680945e853fdb6e0821 Mon Sep 17 00:00:00 2001 From: nathangray Date: Mon, 27 Jul 2020 13:44:11 -0600 Subject: [PATCH] Etemplate: Fix isDirty() was always false for multi-select (tracker selection) --- api/js/etemplate/et2_core_inputWidget.js | 3 +-- api/js/etemplate/et2_core_inputWidget.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/api/js/etemplate/et2_core_inputWidget.js b/api/js/etemplate/et2_core_inputWidget.js index 9a1ed5c25d..6632c3b532 100644 --- a/api/js/etemplate/et2_core_inputWidget.js +++ b/api/js/etemplate/et2_core_inputWidget.js @@ -220,7 +220,6 @@ var et2_inputWidget = /** @class */ (function (_super) { return this._oldValue; }; et2_inputWidget.prototype.isDirty = function () { - var _a; var value = this.getValue(); if (typeof value !== typeof this._oldValue) { return true; @@ -230,7 +229,7 @@ var et2_inputWidget = /** @class */ (function (_super) { } switch (typeof this._oldValue) { case "object": - if (((_a = this._oldValue) === null || _a === void 0 ? void 0 : _a.length) && typeof this._oldValue.length !== "undefined" && + if (typeof this._oldValue.length !== "undefined" && this._oldValue.length !== value.length) { return true; } diff --git a/api/js/etemplate/et2_core_inputWidget.ts b/api/js/etemplate/et2_core_inputWidget.ts index a4afd04157..3c056fab73 100644 --- a/api/js/etemplate/et2_core_inputWidget.ts +++ b/api/js/etemplate/et2_core_inputWidget.ts @@ -324,7 +324,7 @@ export class et2_inputWidget extends et2_valueWidget implements et2_IInput, et2_ switch(typeof this._oldValue) { case "object": - if(this._oldValue?.length && typeof this._oldValue.length !== "undefined" && + if(typeof this._oldValue.length !== "undefined" && this._oldValue.length !== value.length ) {