Primeng: Clear icon for AutoComplete

Created on 15 Aug 2017  路  7Comments  路  Source: primefaces/primeng

when selected item contains many character,we need typewrite BackSpace key too many times,it's not convenient!

new feature

Most helpful comment

Any update on this?

All 7 comments

I need this feature too. something like

I also have need for this.

Would be handy!

Any update on this?

Building on @sanketsw answer:

<p-autoComplete #ref type="search" (onBlur)="onBlur()" ... />
import {AutoComplete} from 'primeng/autocomplete';


@ViewChild('ref') ref: AutoComplete;

onBlur(): void {
  if (!this.ref.inputEL.nativeElement.value) {
      // Set to null manually:
      this.control.setValue(null);
      this.value = null;
  }
}

I also need this feature. Dropdown does it very well with [showClear]="true".

There's a Pull Request above to fix this.

Was this page helpful?
0 / 5 - 0 ratings