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

AutoComplete onSelect bug with forceSelection #6943

Closed
tiagodws opened this issue Dec 3, 2018 · 4 comments
Closed

AutoComplete onSelect bug with forceSelection #6943

tiagodws opened this issue Dec 3, 2018 · 4 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@tiagodws
Copy link

tiagodws commented Dec 3, 2018

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)
Please demonstrate your case at stackblitz by using the issue template below. Issues without a test case have much less possibility to be reviewd in detail and assisted.

https://stackblitz.com/edit/github-6uaqnt

Current behavior
onSelect is called twice when the user types a valid value and the autocomplete is on forceSelection mode.

Expected behavior
onSelect should be called a single time.

Minimal reproduction of the problem with instructions

https://stackblitz.com/edit/github-6uaqnt

  • Type exactly the value of a valid suggestion (e.g. "BR")
  • Click on ANY suggestion
  • Observe that the value of the autocomplete will change twice, and the onSelect will be called twice as well.

What is the motivation / use case for changing the behavior?
This behavior invalidates the main use of the onSelect event: to know when the user has truly selected a suggestion. If the user searches for a name (e.g. "John"), intending to select a "John Silver", but there is an option with just "John", the onSelect will be wrongly called for "John" as well.

Please tell us about your environment:

  • Angular version: 7.X
  • PrimeNG version: 7.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 =

@BobFleischman
Copy link
Contributor

It seems to be only on the first selection. After that it just fires once. Interesting.

@cagataycivici cagataycivici added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Dec 17, 2018
@cagataycivici cagataycivici added this to the 7.0.4 milestone Dec 17, 2018
@cagataycivici cagataycivici changed the title AutoComplete onSelect bug AutoComplete onSelect bug with forceSelection Jan 4, 2019
@dafranklin
Copy link

Hello, that bug is also present in version 6.1.7. For pratical reasons, i can't switch to angular 7. Can I switch to primeng 7 or is it only compatible with angular 7? Or is there going to be further update of primeng 6.x?
Thanks in advance

@tiagodws
Copy link
Author

@cagataycivici @yigitfindikli The problem still persists on 7.0.5

@jcmendes9898
Copy link

Still happening.

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

6 participants