0

I have this simple dropdown and I have a placeholder that says: "none". However, I want to allow the user to clear what he selected from the dropdown without having to add another option in my dropdown. Does anyone know how to accomplish that? Thanks a lot in advance!

Here's my code:

LIVE DEMO

<p-dropdown [options]="options" placeholder="none"></p-dropdown>
Devmix
  • 1,599
  • 5
  • 36
  • 73
  • You will have to add a clear button in order to do this Link:https://stackoverflow.com/questions/44287700/primeng-dropdown-user-cant-clear-the-value – Xion Dec 12 '18 at 18:17
  • it seems to have showClear flag, https://www.primefaces.org/primeng-5-2-2-released/, but I cannot make it work :( – ABOS Dec 12 '18 at 19:06
  • oh, it worked with primeng@5.2.4, not with the version you used in demo. https://stackblitz.com/edit/primeng-dropdown-ba26e2 – ABOS Dec 12 '18 at 19:15

1 Answers1

0

I am pretty sure that your only choices are to add a 'none' option or to have some other control in the form that will have the action of clearing the value of the dropdown.

See: PrimeNg DropDown - User can't clear the value

JayDM
  • 1,166
  • 9
  • 16