Component autocomplete selects items with same "startWith" values when in both multiple and forceSelection modes #16493
Labels
Status: Pending Review
Issue or pull request is being reviewed by Core Team
Milestone
Describe the bug
This is a very specific scenario: using a p-autocomplete component with both "multiple" and "forceSelection" set to true leads to double selection when several items start with the same name (e.g. "flower" and "flower2") and when we search for the substring "flower" and when the value "flower2" is selected with the mouse.
Environment
node v18.19.1
angular 18.0.1
windows 11
Reproducer
https://stackblitz.com/edit/w6y19s?file=src%2Fapp%2Fautocomplete-basic-demo.html
Angular version
18.0.1
PrimeNG version
17.18.11
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
18.19.1
Browser(s)
Chrome, Firefox (don't know about Safari)
Steps to reproduce the behavior
p-autocomplete
with both[forceSelection]="true"
and[multiple]="true"
Expected behavior
A single chip with "flower2" gets selected and added into selectedSuggestions model.
The text was updated successfully, but these errors were encountered: