primeng icon indicating copy to clipboard operation
primeng copied to clipboard

forceSelection not clearing invalid single numbers/strings

Open gustavomerini opened this issue 7 years ago • 1 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/github-9pxw5z?file=src/app/app.component.ts

Current behavior

If I type a number/single string that would not bring any valid value on an Autocomplete(forceSelection=true), it does not clear the invalid value. If I type a number with a letter, it does clear (this should also happen with the single string/number) and after that it does also clear the single number (as shown on the example bellow), but on the first time I type the number, it does not clear.

145

Expected behavior

It should clear the invalid value just like it does after typing a number plus another character.

Minimal reproduction of the problem with instructions type a number on a p-autocomplete (forceSelection=true), for exemple "1" then press tab, it should clear the value because it is an invalid value. https://stackblitz.com/edit/github-9pxw5z?file=src/app/app.component.ts

  • Angular version: 7.0.0
  • PrimeNG version: 7.1.2
  • Browser: [Chrome XX | Firefox XX]
  • Language: [all | TypeScript X.X | ES6/7 | ES5]

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

gustavomerini avatar Jun 24 '19 17:06 gustavomerini

I have the same problem using SSR. On the SSR the autocomplete shows null as string but when render the browser side the null is removed.

rafa-suagu avatar Jul 09 '19 13:07 rafa-suagu