Primeng: Clear icon for Dropdown

Created on 6 Nov 2017  路  12Comments  路  Source: primefaces/primeng

Kindly add clear icon inside all type of input type.

new feature

Most helpful comment

Agree, but IMHO dropdown will have one of highest priorities as in most of other fields you can enter the field and use keyboard to clear it - in dropdown... not :(

All 12 comments

Would love this feature also. Also, Primeng rocks! Thank you for all your hardwork : )

Agree, but IMHO dropdown will have one of highest priorities as in most of other fields you can enter the field and use keyboard to clear it - in dropdown... not :(

Dont know if its still on the pipeline, its not in a milestone any longer, but i cant agree more.
Dropdown feels unhandy without a function to deselect.

For all those who need the feature as fast as I do, take a look at (https://github.com/ng-select/ng-select#examples)

@gsteiner89 Thanks for sharing, looks good.

@cagataycivici any idea when we get these features? Please, give these awesome features.

Not sure about all inputs but we can start with dropdown for sure.

screen shot 2018-03-05 at 10 27 40

Nice, thank you.

When it comes to other inputs the reason may be for example IE - it has it's own "x" for most inputs (other browsers not) which (and it seems to be a bug, but I tried some time ago - maybe it's fixed) does not trigger change PrimeNGs events in on some inputs. It will make controls look and work totally the same on all browsers.

@cagataycivici it's possible to dispatch the change event when clear the dropdown to full control of this functionality? If don't use ngModel to bind the values, you need that the change event fires

hi,
is there a way to remove this functionality?

The "clear icon" can be hide via CSS:

.ui-dropdown .ui-dropdown-clear-icon {
  display: none;
}

Not ideal, but...

5.2.2 is now available;

https://www.primefaces.org/primeng-5-2-2-released/

The icon is invisible by default, [showClear]="true" enables it.

Was this page helpful?
0 / 5 - 0 ratings