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

Removing an item from autocomplete closes p-OverlayPanel #14300

Closed
patjag91 opened this issue Dec 8, 2023 · 2 comments · Fixed by #14303
Closed

Removing an item from autocomplete closes p-OverlayPanel #14300

patjag91 opened this issue Dec 8, 2023 · 2 comments · Fixed by #14303
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

@patjag91
Copy link

patjag91 commented Dec 8, 2023

Describe the bug

P-autocomplete is added into p-OverlayPanel. After selecting an item from autocomplete and trying to remove it the whole overlay is closed

Environment

PrimeNG 17.0, Angular 17

Reproducer

https://stackblitz.com/edit/rcbspb-6wowop

Angular version

17

PrimeNG version

17

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

v18.18.0

Browser(s)

Chrome

Steps to reproduce the behavior

  1. Create a p-autocomplete component inside p-OverlayPanel
  2. add an autocomplete item
  3. remove an item

Expected behavior

Item is removes, overlay stays opened

@patjag91 patjag91 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 8, 2023
@SoyDiego
Copy link
Contributor

SoyDiego commented Dec 8, 2023

A simple workaround you can use is adding dismissable and showCloseIcon props:

<p-overlayPanel #move [dismissable]="false" [showCloseIcon]="true">

I tried in your example and works but yes, should not be closed.

Thanks for report it!

@SoyDiego
Copy link
Contributor

SoyDiego commented Dec 8, 2023

I did a PR solving the problem: #14303

The problem was in AutoComplete component.
When you delete a item, is propaganding event. Adding StopPropagation() solved the problem 🙂

Now we should wait if PrimeNG Team approve it.

@cetincakiroglu cetincakiroglu added this to the 17.1.0 milestone Dec 8, 2023
@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 Dec 8, 2023
@cetincakiroglu cetincakiroglu added the LTS-PORTABLE Issue's fix will be ported to supported LTS versions label Dec 14, 2023
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.

4 participants