Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

p-autocomplete selects wrong/old option on enter #3431

Closed
ThisWillDoIt opened this issue Jul 18, 2017 · 1 comment
Closed

p-autocomplete selects wrong/old option on enter #3431

ThisWillDoIt opened this issue Jul 18, 2017 · 1 comment
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@ThisWillDoIt
Copy link

I'm submitting a ... (check one with "x")

[x] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

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

  1. Go to the official documentation example: https://www.primefaces.org/primeng/#/autocomplete
  2. Write "Fin" in the Basix example input
  3. Click "Finland" in the dropdown
  4. The input gets focus with "Finland" written in in. Remove all text with backspace.
  5. Write "Ger"
  6. Wait until the suggestions dropdown appears
  7. Hit Enter
  8. The selection incorrectly shows "Finland" instead of Germany/Ger/undefined

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 =

@cagataycivici cagataycivici self-assigned this Aug 23, 2017
@cagataycivici cagataycivici added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Aug 23, 2017
@cagataycivici cagataycivici added this to the 4.1.4 milestone Aug 23, 2017
@cagataycivici
Copy link
Member

Fixed along side with 3677

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

2 participants