AAE-46434 Fix read-only field styling on forms (#11928)

This commit is contained in:
David Olson
2026-06-02 08:54:26 -05:00
committed by GitHub
parent e52b63eaf9
commit aa2a357fb2
10 changed files with 75 additions and 21 deletions
@@ -2,6 +2,7 @@
class="{{field.className}}"
id="data-widget"
[class.adf-invalid]="dateInputControl.invalid && dateInputControl.touched"
[class.adf-readonly]="field.readOnly"
[class.adf-left-label-input-container]="field.leftLabels"
>
<div *ngIf="field.leftLabels">
@@ -1,7 +1,7 @@
<form>
<mat-form-field class="adf-cloud-group adf-form-field-input" [class.adf-invalid]="hasError() && isDirty()">
@if (label || required) { <mat-label><span>{{label}}</span></mat-label> }
<mat-chip-grid [required]="required" #groupChipList data-automation-id="adf-cloud-group-chip-list">
<mat-chip-grid [required]="required" [disabled]="isReadonly()" #groupChipList data-automation-id="adf-cloud-group-chip-list">
<mat-chip-row
*ngFor="let group of selectedGroups"
[removable]="!(group.readonly)"
@@ -16,7 +16,7 @@
[formControl]="searchGroupsControl"
[matAutocomplete]="auto"
[matChipInputFor]="groupChipList"
[placeholder]="title | translate"
[placeholder]="isReadonly() ? '' : (title | translate)"
[required]="required"
(focus)="setFocus(true)"
(blur)="setFocus(false); markAsTouched()"
@@ -173,9 +173,6 @@ export class GroupCloudComponent implements OnInit, OnChanges {
}
ngOnChanges(changes: SimpleChanges): void {
if (changes?.readOnly || changes?.validate) {
this.updateSearchControlState();
}
if (this.hasPreselectedGroupsChanged(changes) || this.hasModeChanged(changes) || this.isValidationChanged(changes)) {
if (this.hasPreSelectGroups()) {
this.loadPreSelectGroups();
@@ -188,6 +185,8 @@ export class GroupCloudComponent implements OnInit, OnChanges {
this.invalidGroups = [];
}
}
this.updateSearchControlState();
}
private initSearch(): void {
@@ -9,7 +9,7 @@
</mat-label>
<mat-label *ngIf="title">{{ title | translate }}</mat-label>
<mat-chip-grid [required]="required" #userMultipleChipList data-automation-id="adf-cloud-people-chip-list">
<mat-chip-grid [required]="required" [disabled]="isReadonly()" #userMultipleChipList data-automation-id="adf-cloud-people-chip-list">
<mat-chip-row
*ngFor="let user of selectedUsers"
[removable]="!user.readonly"