-
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 head is empty if no value is provided #14954
Dropdown head is empty if no value is provided #14954
Comments
How about adding a placeholder for it?
|
Hi @dalenguyen, that would be an obvious solution. The thing is that a placeholder is redundant for dropdowns that use a float-label. If no placeholder value is provided, then the expected behavior would be to display something like an empty character. I have updated the |
Hello, i have the same problem! I don't need the placeholder, it's just an optional attribute, but if selected item is null field is shrinking primeng 17.10.0 https://stackblitz.com/edit/d2r6ts?file=src%2Fapp%2Fdemo%2Fdropdown-template-demo.html |
Temporary solution: I think you can try to use global css to fix it:
|
Thanks for your response @dalenguyen I would avoid setting a static height value because the element's height is dynamically calculated as the sum of font-size+padding. Width is always set to 100% of the container element's box size. What I'm doing, for now, is setting the placeholder value to "_". This will display a dash until an option is selected. I can easily apply this system-wide because all |
It's not static. It has a minimum value set |
Yes, you're right, it's not completely static. I want to avoid adding a value based on visual/manual estimation 😃 |
Fix #14954 Dropdown head is empty when no selected option provided
Describe the bug
Dropdown that defines a custom selectedItem template, is empty when no initial value or a placeholder is provided.
Environment
Windows
Reproducer
https://stackblitz.com/edit/yczs8n-mr98fr?file=src%2Fapp%2Fdemo%2Fdropdown-template-demo.html
Angular version
17.1.2
PrimeNG version
17.9.0
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
20.9.0
Browser(s)
No response
Steps to reproduce the behavior
Expected behavior
The dropdown should be the same size as dropdowns with value.
The text was updated successfully, but these errors were encountered: