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

Component: p-autoComplete multiple=true sometimes causes adding different/multiple values if one of them is a prefix of another #15488

Open
malciin opened this issue May 7, 2024 · 0 comments
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@malciin
Copy link

malciin commented May 7, 2024

Describe the bug

Hello,

I've noticed that <p-autoComplete [multiple]="true" ... /> sometimes causes adding multiple values if one of them is prefix of another, and sometimes causes adding prefix value only rather than selected:

chrome_GMhZgo5KUC.mp4

(notice "test" was added rather than "test-1", and later both "test" & "test-1" were added)

To anyone that may have the same issue, the temporary workaround I've came up with is to use suggestions as an objects with prefixed label & custom ng-template:

https://stackblitz.com/edit/github-7hs33e-ciep28?file=src%2Fapp%2Fapp.component.html,src%2Fapp%2Fapp.component.ts

Environment

https://stackblitz.com/edit/github-7hs33e-wudgma?file=src%2Fapp%2Fapp.component.html,src%2Fapp%2Fapp.component.ts

Reproducer

https://stackblitz.com/edit/github-7hs33e-wudgma?file=src%2Fapp%2Fapp.component.html,src%2Fapp%2Fapp.component.ts

Angular version

17.3.7

PrimeNG version

17.16

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

stackblitz so idk

Browser(s)

No response

Steps to reproduce the behavior

  1. Open https://stackblitz.com/edit/github-7hs33e-wudgma?file=src%2Fapp%2Fapp.component.html,src%2Fapp%2Fapp.component.ts
  2. Type "test"
  3. Select "test-1"
  4. Sometimes both "test" and "test-1" were added and sometimes "test" was wrongly added even if user clicked on "test-1".

Expected behavior

Only single selected item is added.

@malciin malciin added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label May 7, 2024
@malciin malciin changed the title Component: p-autoComplete multiple=true sometimes causes adding multiple values if one of them is a prefix of another Component: p-autoComplete multiple=true sometimes causes adding different/multiple values if one of them is a prefix of another May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant