-
Notifications
You must be signed in to change notification settings - Fork 82
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
Hint/Placeholder is blank when select allows empty selection #7243
Comments
Sorry, I find it puzzling that this issue needs a design decision. To me, this seems like a very simple issue. What is the placeholder? It is what is displayed when the field is empty. When is the combo field empty? When nothing is selected and the empty selection caption is not specified (because if it is specified then the field is not empty). And that is how this used to work in V14. There was no conflict |
The reason why this was working in V14 is that In Vaadin 22 and later, the placeholder is also implemented by using cloned web-components/packages/select/src/vaadin-select-base-mixin.js Lines 515 to 521 in f3a9e07
|
Yup, makes sense. As for why this needed a design decision, we wanted to check if there was something fundamentally wrong with the field supporting both placeholder and empty-selection-caption, and if that was something we'd need to look into. But I do think they serve to distinct use cases:
So, let's go ahead and fix this. |
Description
This has worked in Vaadin 14. Switching to V23, we have noticed this issue..
I create a select component, set a placeholder and allow empty selection. Vaadin blanks the set placeholder if a select allows empty selection. @javier-godoy suggested to set an empty selection caption which is displayed in place of placeholder when nothing is selected. However, it creates a weird UI experience when a "placeholder" becomes a selectable option. The example in Vaadin docs has a select(works because it does not allow empty selection) with "Select Size" placeholder and options "XS", "S",... So with the suggested workaround the user will see the following options in the dropdown list: "Select Size", "XS", "S"... Sorry, it is weird.
Expected outcome
Vaadin not blanking out the placeholder if no empty selection caption is set.
Minimal reproducible example
Steps to reproduce
Create a select component using the above code. The combo will not display the set placeholder.
Environment
Vaadin version(s): 23.3.31 - 23.4.0
OS: Windows
Browsers
Chrome
The text was updated successfully, but these errors were encountered: