primeng
primeng copied to clipboard
Autocomplete when multiple=true and typeahead=false ignores unique=true
Describe the bug
As you can see in the Autocomplete examples in both v18 and v19, in the Multiple section, the "with typeahead" unique works but the "without typeahead" unique doesn't work. The "Without Typeahead" example allows you to enter multiple of the same entry.
Pull Request Link
No response
Reason for not contributing a PR
- [ ] Lack of time
- [ ] Unsure how to implement the fix/feature
- [ ] Difficulty understanding the codebase
- [ ] Other
Other Reason
No response
Reproducer
https://stackblitz.com/edit/ey7saxmy?file=src%2Fapp%2Fautocomplete-multiple-demo.html
Environment
Windows environment, Chrome browser
Angular version
v19
PrimeNG version
v19
Node version
No response
Browser(s)
No response
Steps to reproduce the behavior
- Go to https://primeng.org/autocomplete
- Go to the Multiple section
- In the "Without Typeahead" example, enter "test" multiple times
- Observe that non-unique entries are allowed
According to the API, unique=true is the default. But even going into Stackblitz of the example and explicitly setting [unique]="true", it still allows the same text entered multiple times.
Expected behavior
When unique=true, it should not allow the same string to be added if it has already been added.