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 dropdown should not show "empty" option #14337

Closed
yunusyerli1 opened this issue Dec 12, 2023 · 2 comments
Closed

Multiselect dropdown should not show "empty" option #14337

yunusyerli1 opened this issue Dec 12, 2023 · 2 comments
Labels
Resolution: Workaround Issue or pull request contains a workaround. It needs to be reviewed further by Core Team

Comments

@yunusyerli1
Copy link

Describe the bug

Screenshot from 2023-12-12 17-04-26
ı am getting the array like in the image. The first object in the array which label and value are empty. So, ı expect multiselect dropdown should not show empty option . See below image:
Screenshot from 2023-12-12 17-07-54

Environment

Ubuntu and docker

Reproducer

No response

Angular version

16

PrimeNG version

16.9.1

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

18.17.1

Browser(s)

Chrome

Steps to reproduce the behavior

  1. Create a list with one empty label and empty value
  2. Check multiselect
  3. Empty option will be seen

Expected behavior

if array member has empty label, the dropdown should not show it

@yunusyerli1 yunusyerli1 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 12, 2023
@cetincakiroglu
Copy link
Contributor

Hi,

It's made by design, not a bug. Users use the component with values, not empty objects. Instead of updating the component, you can simply remove the empty object and use the component.

@cetincakiroglu cetincakiroglu added Resolution: Workaround Issue or pull request contains a workaround. It needs to be reviewed further by Core Team 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 13, 2023
@yunusyerli1
Copy link
Author

I cant change empty object array since the array is dynamic and being used in many places. I just thought logically if label comes with no value, dropdown shouldnt show it or at least there should be an built-in option to choose such a thing. Anyway, ı got your response. Thank you Mr Çetin Bey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Workaround Issue or pull request contains a workaround. It needs to be reviewed further by Core Team
Projects
None yet
Development

No branches or pull requests

2 participants