Primeng: Autocomplete input field not cleared or reset

Created on 21 Jul 2017  路  8Comments  路  Source: primefaces/primeng

Current behavior
p-autocomplete input field is not cleared/reset to null if I dont select an option from suggestion

Expected behavior
Input field should be reset to null

Minimal reproduction of the problem with instructions

Start type 'abc'
Do not choose a value from the option
Perform clear (Here using clear button which invoke method to make customerRequest null)

Result: customerRequest (model) set to null but the input field is not cleared/reset.

Expected: Field should be reset to null.

If I select some value from the option and clear, field is reset to null. Please address this issue.

  • Angular version: 2.0.X

  • PrimeNG version: 4.0.X

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]

  • Language: [all | TypeScript X.X | ES6/7 | ES5]

  • Node (for AoT issues): node --version =

Most helpful comment

@cagataycivici Issue still exists (5.2.4) when you manually clear the input.
Type 'a' / Select an option / FormModel updated / clear the input / focus out / the FormModel still contains the old selection and the valueChange observable does not emit the value.
Workaround : use the onClear to manually set the formControl value to null...

All 8 comments

I see this exact problem as well. Upvoting for a fix.

Upvoting for a fix as well.

Tracked at #3479

you referenced same ticket number ? where is this tracked ?
and there's no 4.1.4 milestone , you refer to 4.2.0 rc1 ?
thanks

@cagataycivici fixed in v4.2.0 if [multiple]="false" but not if you use [multiple]="true"

Bump :-)
Doesn't seem to be fixed if not if you use [multiple]="true".
Has anyone got a work-around, even changing the dom element?

@cagataycivici Issue still exists (5.2.4) when you manually clear the input.
Type 'a' / Select an option / FormModel updated / clear the input / focus out / the FormModel still contains the old selection and the valueChange observable does not emit the value.
Workaround : use the onClear to manually set the formControl value to null...

Still exists "primeng": "^6.1.4.
I've two "autocomplete" and i clear manually. One clear and the another in screen continue with value. Even when binding variable is null

Was this page helpful?
0 / 5 - 0 ratings