p-autocomplete selects wrong/old option on enter #3431
Labels
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
I'm submitting a ... (check one with "x")
Plunkr Case (Bug Reports)
Issue can be reproduced on official documentation example:
https://www.primefaces.org/primeng/#/autocomplete
Current behavior
When filling out the autocomplete input box without clicking a dropdown item and hitting enter a previously clicked dropdown options gets selected.
Expected behavior
Either select the first option in the new suggestions dropdown or if none is present submit undefined.
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
The user doesn't expect to get an previously selected option if it doesn't match at all with the current search term.
Please tell us about your environment:
Angular version:
4.3.0, 4.2.6
PrimeNG version:
4.1, 4.03
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 ]
Chrome 59.0.3071.115, Firefox 54.0.1, Microsoft Edge 40.15063.0.0
Language: [all | TypeScript X.X | ES6/7 | ES5]
TypeScript 2.4.1 + whatever version is used for the official documentation page
Node (for AoT issues):
node --version
=The text was updated successfully, but these errors were encountered: