-
-
Notifications
You must be signed in to change notification settings - Fork 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
fix(VSelects): recognize empty string as no value #20742
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess whether empty string is real empty is pretty subjective, different people take it differently, so I guess it's important for us to agree on an opinionated direction in Vuetify and make it clear in docs:
Current implementation can be found in this demo (empty string is legit and non-empty).
Visually, now it looks to me that makes sense to treat empty string to be real empty, for both v-text-field & all select components.
Need an opinionated agreement here, then implement and put it into docs. @johnleider @KaelWD
I think we should try to normalize this if we can. I agree with @yuwu9145 |
@johnleider by looking at this demo, should empty string be treated as real empty like null & undefined here? |
My instinct is saying it should mimic the native select functionality / behavior since that it's direct replacement. |
On the contrary I get the feeling native controls are usually inferior to what frameworks provide and aligning with them means giving up UX improvements. In case of Giulio's argument was pretty strong – user can type something and clear it with backspace, ending up with |
Description
Selection controls should correctly reflect empty state. And most of the times empty string is perceived by end users as "no value". There is an edge case if
""
is among options' values - it results in selection in VSelection and VAutocomplete, while VCombobox will not recognize it as selection because it does not care about item value (thus has hardcoded['']
and won't consumeemptyValues
fromuseItems
)fixes #20660
Markup: