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: Allow empty string while not showing clear button #11836

Closed
Foxandxss opened this issue Aug 17, 2022 · 0 comments · Fixed by #11849
Closed

Dropdown: Allow empty string while not showing clear button #11836

Foxandxss opened this issue Aug 17, 2022 · 0 comments · Fixed by #11849
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@Foxandxss
Copy link

Describe the bug

When setting [showClear] as true it will show up if the default "value" is an empty string. Initializing a form with empty strings is a recommended practice by the angular team.

Environment

Happens in both stackblitz and local project

Reproducer

https://stackblitz.com/edit/primeng-dropdown-demo-yz3mvk

Angular version

14.0.0

PrimeNG version

14.0.1

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

16.x.x

Browser(s)

All of them

Steps to reproduce the behavior

Check how the first example works as expected but the second one shows up the X even if the placeholder is showing up.

Expected behavior

The *ngIf for the icon should take in account empty strings as well.

@Foxandxss Foxandxss added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Aug 17, 2022
volvachev added a commit to volvachev/primeng that referenced this issue Aug 20, 2022
@cetincakiroglu cetincakiroglu added this to the 14.0.2 milestone Aug 24, 2022
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