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: MultiSelect ExpressionChangedAfterItHasBeenCheckedError when spam clicking #13942

Closed
nathanvj opened this issue Oct 23, 2023 · 2 comments · Fixed by #13956
Closed
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@nathanvj
Copy link

Describe the bug

When you spam click on the MultiSelect input to open the options, you get the following error in console.

ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'false'. Current value: 'true'. Expression location: MultiSelect component.

See here:
Screenshot 2023-10-23 at 12 28 43

Environment

N/A

Reproducer

https://stackblitz.com/edit/c75mkf?file=package.json

Angular version

16.2.0

PrimeNG version

16.5.1

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

n/a

Browser(s)

No response

Steps to reproduce the behavior

  1. Open the StackBlitz
  2. Spam click on the MultiSelect a couple times
  3. Check console (only visible in a dev environment)

Expected behavior

To not have the errors in console

@nathanvj nathanvj added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Oct 23, 2023
@maruthumj
Copy link
Contributor

maruthumj commented Oct 25, 2023

@nathanvj I'm taking this one and also this will be my first contribution to the open source world!

@cetincakiroglu cetincakiroglu added this to the 16.6.0 milestone Oct 26, 2023
cetincakiroglu added a commit that referenced this issue Oct 26, 2023
Bug fix: #13942 Multi select component console error
@cetincakiroglu cetincakiroglu added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Oct 26, 2023
@turp
Copy link

turp commented Oct 30, 2023

Unfortunately, this doesn't fix the issue. Please see https://stackblitz.com/edit/dtvhna?file=src%2Fapp%2Fdemo%2Fmulti-select-virtual-scroll-demo.html,package.json and quickly click multiple times on the multiselect dropdown.

I thought that by adding [virtualScroll]="true" might do the trick, but it doesn't seem to affect the behavior

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
Development

Successfully merging a pull request may close this issue.

4 participants