MultiSelect editable option

UI Components for Angular
Post Reply
Checkmater
Posts: 1
Joined: 22 Feb 2019, 02:18

22 Feb 2019, 02:23

It would be great if you can please add the editable option to the MultiSelect component just like the one you can find in the DropDown component, right now if you want the user to add a new tag you have to put another box for them to be able to add new ones.

Is there any already existing workaround for this or where can I submit the suggestion properly?

Thanks!

yigitfindikli
Posts: 449
Joined: 08 Aug 2018, 14:09

22 Feb 2019, 15:38

Checkmater wrote:
22 Feb 2019, 02:23
It would be great if you can please add the editable option to the MultiSelect component just like the one you can find in the DropDown component, right now if you want the user to add a new tag you have to put another box for them to be able to add new ones.

Is there any already existing workaround for this or where can I submit the suggestion properly?

Thanks!
Hi,
You can use header template. Put inputtext and button in header template, like this;

https://stackblitz.com/edit/github-jawba9

Best Regards.

PrimebyDesign
Posts: 2
Joined: 12 May 2017, 17:42

14 Mar 2021, 16:26

I'm afraid that just doesn't cut it. Things don't look right when you use the method above.

the following :

Code: Select all

<p-multiSelect [options]="cars" [(ngModel)]="selectedCars1" [panelStyle]="{minWidth:'12em'}">
  <p-header>

    <div class="p-grid">
      <div class="p-col-8"><input type="text" pInputText style="min-height:2em"/></div>
      <div class="p-col-1"><p-button (click)="add(in)" style="max-height:2em">Add</p-button></div>
    </div>

  </p-header>
</p-multiSelect>
looks like this: (https://ibb.co/zhV6GD5)
Image

It's just about hackable but it's not pretty.

rajeev.tripathi
Posts: 6
Joined: 12 Jul 2021, 13:15

28 Jan 2022, 14:38

Instead of multiselect, the autocomplete can solve your problem. I have created an example on stackblitz.

Here is the link - https://stackblitz.com/edit/primeng-aut ... demo-1yzub

This has a dropdown, it can filters results and also a new entry can be added.

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 8 guests