1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-12 06:23:38 +00:00

fix multiselect

This commit is contained in:
Vicki League
2025-06-25 16:28:14 -04:00
parent 40928a9b9b
commit 5d974fe5e2
2 changed files with 8 additions and 5 deletions

View File

@@ -13,7 +13,7 @@
[multiple]="true"
[closeOnSelect]="false"
(close)="onDropdownClosed()"
[disabled]="disabled()"
[disabled]="disabled"
[clearSearchOnAdd]="true"
[labelForId]="labelForId"
[keyDownFn]="keyDown"
@@ -28,7 +28,7 @@
bitBadge
variant="primary"
class="tw-me-1 disabled:tw-border-0 tw-flex tw-gap-1.5 tw-items-center"
[disabled]="disabled()"
[disabled]="disabled"
(click)="clear(item)"
>
@if (item.icon != null) {

View File

@@ -13,6 +13,7 @@ import {
Self,
input,
model,
booleanAttribute,
} from "@angular/core";
import {
ControlValueAccessor,
@@ -55,7 +56,9 @@ export class MultiSelectComponent implements OnInit, BitFormFieldControl, Contro
readonly removeSelectedItems = input(false);
placeholder = model<string>();
readonly loading = input(false);
disabled = model<boolean>();
// TODO: Skipped for signal migration because:
// Your application code writes to the input. This prevents migration.
@Input({ transform: booleanAttribute }) disabled?: boolean;
// Internal tracking of selected items
protected selectedItems: SelectItemView[];
@@ -154,7 +157,7 @@ export class MultiSelectComponent implements OnInit, BitFormFieldControl, Contro
/**Implemented as part of NG_VALUE_ACCESSOR */
setDisabledState(isDisabled: boolean): void {
this.disabled.set(isDisabled);
this.disabled = isDisabled;
}
/**Implemented as part of NG_VALUE_ACCESSOR */
@@ -195,7 +198,7 @@ export class MultiSelectComponent implements OnInit, BitFormFieldControl, Contro
readonly id = input(`bit-multi-select-${nextId++}`);
/**Implemented as part of BitFormFieldControl */
// TODO: Skipped for migration because:
// TODO: Skipped for signal migration because:
// Accessor inputs cannot be migrated as they are too complex.
@HostBinding("attr.required")
@Input()