-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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 empty label shows "empty" #3964
Comments
Hello @Ketec I think in your case the best solution will be to set property Also you should remember when value is empty I hope this helps. |
@Sumragen using empty string or null causes primeng to show text "empty". |
@Ketec I'm agree with you, but look at the level above. |
But it still shows empty in the dropdown input. |
I think that the dropdown input shows empty when an empty option is selected is due to this line : If we defined our option label as an empty string : What i don't understand is why the label is set to empty if : Please correct me if i misunderstood anything. |
Some explanations PrimeNG team ? Expected behaviour ? It will be a setting or something in the future ? |
Same problem on dropdown in datatable's filters with latest version of PrimeNG, any explanation please ? |
Seems to be fixed at; |
If there is no label in the object still shows empty :( |
Yes, shows empty in PrimeNG10 and 11 but works well in 9 and before |
This issue comes back in version 11, I created an issue for it: #9722. There is a workaround - add a space to the label, so the empty item looks like this: {label: ' ', value: null}, but it required additional styling - the dropdown is collapsed with selected empty item. |
Note that if you added a |
Current behavior
Adding a item with empty string causes dropdown to show "empty".
<span *ngIf="!itemTemplate">{{option.label||'empty'}}</span>
Adding string with just a space causes item to lose height.
Expected behaviour
Shows empty entry without text.
What is the motivation / use case for changing the behaviour?
To add a option for deselecting/choosing none (grid filters for example).
The text was updated successfully, but these errors were encountered: