Skip to content

Commit

Permalink
Add clear selection option in search-selector (#2860)
Browse files Browse the repository at this point in the history
  • Loading branch information
reiterl authored Oct 9, 2023
1 parent af2f013 commit ab0c23b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@
placeholder="{{ 'Category' | translate }}"
[repo]="categoryRepo"
[excludeIds]="true"
[addClearSelection]="true"
></os-repo-search-selector>
</mat-form-field>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
>
{{ noOptionsFoundLabel | translate }}
</mat-option>
<mat-option *ngIf="addClearSelection">-</mat-option>
<mat-option
#currentOption
*cdkVirtualFor="let selectableItem of filteredItemsObservable | async"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ export abstract class BaseSearchSelectorComponent extends BaseFormFieldControlCo
@Input()
public wider = false;

/**
* If true, a clear selection option is added to the selection list.
*/
@Input()
public addClearSelection = false;

public itemSizeInPx = 50;

public get panelHeight(): number {
Expand Down

0 comments on commit ab0c23b

Please sign in to comment.