From 5d974fe5e2be26c26984102831e84ecdf863d91e Mon Sep 17 00:00:00 2001 From: Vicki League Date: Wed, 25 Jun 2025 16:28:14 -0400 Subject: [PATCH] fix multiselect --- .../src/multi-select/multi-select.component.html | 4 ++-- .../src/multi-select/multi-select.component.ts | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/libs/components/src/multi-select/multi-select.component.html b/libs/components/src/multi-select/multi-select.component.html index 1b6fb554403..8aa45b7dae8 100644 --- a/libs/components/src/multi-select/multi-select.component.html +++ b/libs/components/src/multi-select/multi-select.component.html @@ -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) { diff --git a/libs/components/src/multi-select/multi-select.component.ts b/libs/components/src/multi-select/multi-select.component.ts index d7a952b92e9..34552ceeb9a 100644 --- a/libs/components/src/multi-select/multi-select.component.ts +++ b/libs/components/src/multi-select/multi-select.component.ts @@ -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(); readonly loading = input(false); - disabled = model(); + // 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()