ng-select icon indicating copy to clipboard operation
ng-select copied to clipboard

Multiple select missing selected option template

Open lukashpvp opened this issue 7 years ago • 0 comments

There is a problem with multiple select which does not have a possibility to customize template of selected options(value). It is working properly for single select where you can define custom #optionTemplate and rewrite at once template for option(dropdown) and selected option(value).

In this part of code u can see how it is implemented for single select: https://github.com/basvandenberg/ng-select/blob/master/src/select.component.html#L13

<div class="value" *ngIf="optionList.hasSelected">
    <ng-template [ngOutletContext]="{option: optionList.selection[0], onDeselectOptionClick: onDeselectOptionClick}" [ngTemplateOutlet]="optionTemplate"></ng-template>
    <span *ngIf="!optionTemplate">{{optionList.selection[0].label}}</span>
</div>
.
.
.

In here you can see it is missing for multiple select: https://github.com/basvandenberg/ng-select/blob/master/src/select.component.html#L39

<div class="option" *ngFor="let option of optionList.selection">
    <span class="deselect-option" (click)=onDeselectOptionClick(option)>
         &#x2715;
    </span>
    {{option.label}}
</div>

Can you please look into this issue?

lukashpvp avatar Aug 23 '17 12:08 lukashpvp