neo.mjs 4.6.0 → 4.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/form/field/Text.mjs +7 -4
package/package.json
CHANGED
package/src/form/field/Text.mjs
CHANGED
@@ -567,18 +567,21 @@ class Text extends Base {
|
|
567
567
|
* @protected
|
568
568
|
*/
|
569
569
|
afterSetValue(value, oldValue) {
|
570
|
-
let me
|
571
|
-
cls
|
570
|
+
let me = this,
|
571
|
+
cls = me.cls,
|
572
|
+
emptyValue = Neo.isEmpty(value),
|
573
|
+
originalValue = me.originalConfig.value,
|
574
|
+
isDirty = value !== originalValue && emptyValue !== Neo.isEmpty(originalValue);
|
572
575
|
|
573
576
|
me.silentVdomUpdate = true;
|
574
577
|
|
575
578
|
me.getInputEl().value = value;
|
576
579
|
|
577
|
-
if (
|
580
|
+
if (emptyValue !== Neo.isEmpty(oldValue)) {
|
578
581
|
NeoArray[value !== null && value.toString().length > 0 ? 'add' : 'remove'](cls, 'neo-has-content');
|
579
582
|
}
|
580
583
|
|
581
|
-
NeoArray[
|
584
|
+
NeoArray[isDirty ? 'add' : 'remove'](cls, 'neo-is-dirty');
|
582
585
|
me.cls = cls;
|
583
586
|
|
584
587
|
me.validate(); // silent
|