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

p-dropdown: when filtering, placeholder is displayed even if there is a selected option #14282

Closed
estellepicq opened this issue Dec 6, 2023 · 1 comment
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@estellepicq
Copy link
Contributor

estellepicq commented Dec 6, 2023

Describe the bug

  • p-dropdown uses [filter]="true" feature
  • An option is already selected in the dropdown ✅
  • The dropdown displays the selected option label ✅
  • Open the overlay again to search for another option ✅
  • Type in the filter input ✅
  • The dropdown displays the placeholder above the selected option label ❌

image

It should keep displaying the selected option label.

Environment

PrimeNG official documentation: https://primeng.org/dropdown#filter

Reproducer

https://primeng.org/dropdown#filter

Angular version

17.0.0

PrimeNG version

17.0.0-rc.1

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

18.16.0

Browser(s)

No response

Steps to reproduce the behavior

  • Select an option in the dropdown
  • Open the overlay again to search for another option
  • Type in the filter input

Expected behavior

Only the selected option label should be displayed.

I've forked and fixed it, let me know if you'd like a PR:

image

image

@estellepicq estellepicq 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 6, 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 6, 2023
@cetincakiroglu cetincakiroglu self-assigned this Dec 6, 2023
@cetincakiroglu cetincakiroglu added this to the 17.0.0 milestone Dec 6, 2023
@abroekhuis
Copy link

I know this one is closed, but am wondering if this will be backported to a fix for version 16 as well. As can be seen on the version examples, the same problem occurs there.

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

No branches or pull requests

3 participants