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

forceSelection not clearing invalid single numbers/strings #7841

Closed
gustavomerini opened this issue Jun 24, 2019 · 1 comment
Closed

forceSelection not clearing invalid single numbers/strings #7841

gustavomerini opened this issue Jun 24, 2019 · 1 comment
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@gustavomerini
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)
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

@rafa-suagu
Copy link

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.

@cagataycivici cagataycivici added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Jul 23, 2019
@cagataycivici cagataycivici added this to the 8.0.3 milestone Jul 23, 2019
JacobSiegle pushed a commit to JacobSiegle/primeng that referenced this issue Oct 2, 2019
JacobSiegle pushed a commit to JacobSiegle/primeng that referenced this issue Oct 2, 2019
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
4 participants