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

MultiSelect: onPanelHide triggers twice #12382

Closed
ppaulis opened this issue Dec 14, 2022 · 1 comment · Fixed by #12446
Closed

MultiSelect: onPanelHide triggers twice #12382

ppaulis opened this issue Dec 14, 2022 · 1 comment · Fixed by #12446
Assignees
Labels
LTS-PORTABLE Issue's fix will be ported to supported LTS versions Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@ppaulis
Copy link

ppaulis commented Dec 14, 2022

Describe the bug

We are using multiple multiSelects in our applications and after upgrading primeng from 13.1.1 to 14.2.2 (along with an upgrade to Angular v14), the (onPanelHide) event seems to trigger twice. On 13.1.1 everything worked fine.

After a few tests in the Stackblitz, it seems that the bug has been introducted with PrimeNG v14.2.0. On v14.1.x eveything works as expected.

<p-multiSelect
    [options]="inventoryLocations"
    [(ngModel)]="selectedInventoryLocations"
    optionLabel="name"
    (onPanelHide)="filterUpdated()"
    placeholder="Select Location(s)"
></p-multiSelect>

Environment

Angular v14.2
Node 16.15.0

Reproducer

https://github-97sg5b.stackblitz.io/

Angular version

14.2.12

PrimeNG version

14.2.2

Build / Runtime

TypeScript

Language

TypeScript

Node version (for AoT issues node --version)

16.15.0

Browser(s)

Chrome, Firefox

Steps to reproduce the behavior

In the Stackblitz:

  1. Select/Deselect one or more elements in the multiSelect
  2. Click outside the multiSelect to trigger the onPanelHide
  3. The counter below the multiSelect increments twice

Expected behavior

I expect the onPanelHide event to be triggered only once when closing the panel of the multiSelect.

@ppaulis ppaulis added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Dec 14, 2022
@jayee
Copy link

jayee commented Dec 22, 2022

Also, when the multiselect is destroyed/unloaded the onPanelClose is triggered, even when never opened in the first place.
Tested in 14.2.3

@cetincakiroglu cetincakiroglu added this to the 15.0.1 milestone Dec 28, 2022
@cetincakiroglu cetincakiroglu added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working LTS-PORTABLE Issue's fix will be ported to supported LTS versions and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Dec 29, 2022
cetincakiroglu added a commit that referenced this issue Jan 2, 2023
Fixed #12382 - MultiSelect: onPanelHide triggers twice
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LTS-PORTABLE Issue's fix will be ported to supported LTS versions 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.

5 participants