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: Clear button is visible when field has empty array as value #14145

Closed
nur-psoehnlein opened this issue Nov 17, 2023 · 0 comments
Closed
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@nur-psoehnlein
Copy link

nur-psoehnlein commented Nov 17, 2023

Describe the bug

In PrimeNG < 16.7.1 one could populate a FormControl that is bound to a <p-multiSelect [showClear]="true"> with an empty array and the clear button would only show up if there are actual values selected.

Starting with 16.7.1 the clear button would always show up, except if the FormControl value is set to null (instead of an empty array).

Environment

Browser independent.

Behaviour discovered in one of our apps that uses the Diamond Template, but the StackBlitz reproducer proves, that this also happens outside of that app.

Reproducer

https://stackblitz.com/edit/github-avwzhm-4rytc3?file=src%2Fapp%2Fapp.component.html,src%2Fapp%2Fapp.component.ts

Angular version

16.2.12

PrimeNG version

16.7.2

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

18.18.0

Browser(s)

All

Steps to reproduce the behavior

See reproducer.

Expected behavior

Empty array should be handled like null and the clear button should only be visible when at least one value is selected.

@nur-psoehnlein nur-psoehnlein added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 17, 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 Nov 17, 2023
@cetincakiroglu cetincakiroglu self-assigned this Nov 17, 2023
@cetincakiroglu cetincakiroglu added this to the 16.8.0 milestone Nov 17, 2023
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

2 participants