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

Dropdown: Clicking on currently selected item no longer closes the list #14917

Closed
PeterHewat opened this issue Mar 1, 2024 · 1 comment · Fixed by #14920
Closed

Dropdown: Clicking on currently selected item no longer closes the list #14917

PeterHewat opened this issue Mar 1, 2024 · 1 comment · Fixed by #14920
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@PeterHewat
Copy link

Describe the bug

Previously, clicking on any item in a dropdown list would close it even if the item was already selected. Recently, the behaviour has changed: clicking on an item in the list closes it except if it is the currently selected item.

Environment

Reproducer

No response

Angular version

17.*

PrimeNG version

17.9.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

Browser(s)

Steps to reproduce the behavior

Go to the documentation of the Dropdown component: https://primeng.org/dropdown
On the first dropdown, select "New York" => The item is selected and the list disappears. (OK)
Open the dropdown again and select "New York" again => The list remains visible. (not OK)

Expected behavior

On previous versions (<= 17.4.0), the list would always disappear which is what a dropdown should do regardless of which is the currently selected item.
You can check the old (good) behaviour here: https://www.primefaces.org/primeng-v16-lts/dropdown

@PeterHewat PeterHewat added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Mar 1, 2024
@PeterHewat
Copy link
Author

Before (good):
Dropdown-always-closes-on-any-item-click
After (bad):
Dropdown-no-longer-closes-on-selected-item-click

@mehmetcetin01140 mehmetcetin01140 self-assigned this Mar 1, 2024
@mehmetcetin01140 mehmetcetin01140 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 Mar 1, 2024
@mehmetcetin01140 mehmetcetin01140 added this to the 17.10.0 milestone Mar 1, 2024
mehmetcetin01140 added a commit that referenced this issue Mar 1, 2024
cetincakiroglu added a commit that referenced this issue Mar 6, 2024
Fixed #14917 - Dropdown | Clicking on currently selected item no long…
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.

2 participants