primeng icon indicating copy to clipboard operation
primeng copied to clipboard

AutoComplete onSelect bug

Open csvinhal opened this issue 7 years ago • 3 comments

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/angular-5qgqqr

Current behavior onSelect is called twice when the user hold the mouse click for a second.

Expected behavior onSelect should be called a single time.

Minimal reproduction of the problem with instructions https://stackblitz.com/edit/angular-5qgqqr

  • Type exactly a valid value (e.g. "BR");
  • Click on suggestion "BR" and hold on the click for a second;
  • 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.

  • Angular version: 7.X

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

csvinhal avatar May 21 '19 21:05 csvinhal

Setting [forceSelection]="false" or removing the forceSelection property since false is the default, seems to fix the issue. Not sure why though...

rmundy avatar Jun 18 '19 23:06 rmundy

@yigitfindikli is this fixed? this a problem not only when holding but just choosingusing the keyboard, selectItem() is called twice:

  • onKeydown
  • onInputChange

yelhouti avatar Aug 27 '19 06:08 yelhouti

Unable to replicate with PrimeNG 9, if the issue persists please create a new ticket with a test case reproducing the issue e.g. stackblitz or a github repo and it will be reviewed by our team once again.

cagataycivici avatar Mar 24 '20 21:03 cagataycivici