mirror of
https://github.com/bitwarden/browser
synced 2025-12-10 13:23:34 +00:00
[PM-2102] Implement logic to keep row control enable/disable status in sync with the access item properties whenever the parent control is enabled/disabled (#5433)
Angular 15 introduced a breaking change that calls setDisabledState() whenever a CVA is added. This was re-enabling all the internal form group rows (even those that should have remained disabled).
This commit is contained in:
@@ -198,4 +198,18 @@ export class FormSelectionList<
|
||||
this.selectItem(selectedItem.id, selectedItem);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to iterate over each "selected" form control and its corresponding item
|
||||
* @param fn - The function to call for each form control and its corresponding item
|
||||
*/
|
||||
forEachControlItem(
|
||||
fn: (control: AbstractControl<Partial<TControlValue>, TControlValue>, value: TItem) => void
|
||||
) {
|
||||
for (let i = 0; i < this.formArray.length; i++) {
|
||||
// The selectedItems array and formArray are explicitly kept in sync,
|
||||
// so we can safely assume the index of the form control and item are the same
|
||||
fn(this.formArray.at(i), this.selectedItems[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user