@ascentgl/ads-ui 21.114.4 → 21.114.6
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.
|
@@ -2784,7 +2784,15 @@ class AbstractBaseComponent {
|
|
|
2784
2784
|
if (this.displayControl.touched && this.displayControl.invalid) {
|
|
2785
2785
|
this.displayControl.setValue(null, { emitEvent: false });
|
|
2786
2786
|
}
|
|
2787
|
-
|
|
2787
|
+
// When immediateValidation is active, re-mark as touched so the error border
|
|
2788
|
+
// appears even after a programmatic reset() call.
|
|
2789
|
+
if (this.immediateValidation && this.valueControl.invalid) {
|
|
2790
|
+
this.valueControl.markAsTouched({ onlySelf: true });
|
|
2791
|
+
this.displayControl.markAsTouched();
|
|
2792
|
+
}
|
|
2793
|
+
else {
|
|
2794
|
+
this.displayControl.markAsUntouched();
|
|
2795
|
+
}
|
|
2788
2796
|
}
|
|
2789
2797
|
else if (this.displayControl.untouched) {
|
|
2790
2798
|
this.displayControl.markAsTouched();
|
|
@@ -6085,7 +6093,15 @@ class AdsDatetimepickerComponent extends AbstractInputComponent {
|
|
|
6085
6093
|
*sync display control statuses with value control status for proper error display
|
|
6086
6094
|
* make sure "displayControl" disabled state and value are synchronized with "control" disabled state and value
|
|
6087
6095
|
*/
|
|
6088
|
-
this.subscriptions.push(this.valueControl.statusChanges.subscribe((status) =>
|
|
6096
|
+
this.subscriptions.push(this.valueControl.statusChanges.subscribe((status) => {
|
|
6097
|
+
// Sync validators from valueControl to displayControl to handle dynamically added/removed validators.
|
|
6098
|
+
// Without this, displayControl keeps its original validators and shows stale errors
|
|
6099
|
+
// (e.g. required error after Validators.required was removed from valueControl).
|
|
6100
|
+
this.displayControl.setValidators(this.valueControl.validator);
|
|
6101
|
+
this.displayControl.setAsyncValidators(this.valueControl.asyncValidator);
|
|
6102
|
+
this.displayControl.updateValueAndValidity({ emitEvent: false });
|
|
6103
|
+
this.syncState(status);
|
|
6104
|
+
}));
|
|
6089
6105
|
this.subscriptions.push(this.valueControl.valueChanges.subscribe(() => this.syncDisplayedValue()));
|
|
6090
6106
|
/**
|
|
6091
6107
|
* NOTE: registering display value change is needed to know when to focus time part of datetime if showTimePicker is false
|