Fix disabled control

This commit is contained in:
Thomas Avery 2024-04-02 12:26:08 -05:00
parent f327968d38
commit 06f59f6100
No known key found for this signature in database
GPG Key ID: A60B3C6A4F4EC228
1 changed files with 4 additions and 4 deletions

View File

@ -47,7 +47,7 @@ export class AccessPolicySelectorComponent implements ControlValueAccessor, OnIn
item: ApItemViewType, item: ApItemViewType,
) => { ) => {
// Disable entire row form group if readOnly // Disable entire row form group if readOnly
if (item.readOnly) { if (item.readOnly || this.disabled) {
controlRow.disable(); controlRow.disable();
} else { } else {
controlRow.enable(); controlRow.enable();
@ -174,11 +174,11 @@ export class AccessPolicySelectorComponent implements ControlValueAccessor, OnIn
} else { } else {
this.formGroup.enable(); this.formGroup.enable();
this.multiSelectFormGroup.enable(); this.multiSelectFormGroup.enable();
}
// The enable() above automatically enables all the row controls, // The enable() above automatically enables all the row controls,
// so we need to disable the readonly ones again // so we need to disable the readonly ones again
this.updateAllRowControlDisableStates(); this.updateAllRowControlDisableStates();
} }
}
/** Required for NG_VALUE_ACCESSOR */ /** Required for NG_VALUE_ACCESSOR */
writeValue(selectedItems: ApItemValueType[]): void { writeValue(selectedItems: ApItemValueType[]): void {