Home > Net >  PrimeNg remove multiselect label
PrimeNg remove multiselect label

Time:10-04

I'm trying to remove multiselect label of selected items ,And replace it with static defaultLabel ,,

What Its show enter image description here

I tryed this one :

    .p-multiselect-label {
    visibility: collapse;
    overflow: hidden;
    white-space: nowrap;
  }

It's remove any selected label but when the selected label is increased there is white space is increased too & i can't add defaultLabel whene there are any selectd item!

What I want enter image description here

CodePudding user response:

You could override the selected items template:

<p-multiSelect #multiSelect defaultLabel="Select a city">
  <ng-template pTemplate="selectedItems">
    {{ multiSelect.defaultLabel }}
  </ng-template>
</p-multiSelect>

StackBlitz

  • Related