-
Notifications
You must be signed in to change notification settings - Fork 83
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
[checkbox] Should we introduce the label
property?
#980
Comments
Might be a nice convenience API. Light DOM content should take priority over the property/attribute, IMO. A warning is probably in order, yes. |
I’m not sure, but this also sounds like a potential use case for vaadin/vaadin-core#150 (a generic “field wrapper” element). It might even be that For exapmle: <vaadin-form-item label="Terms and conditions" required error-message="You need to agree in order to continue">
<vaadin-checkbox>Yes, I agree</vaadin-checkbox>
</vaadin-form-item> |
Forcing users to use a wrapper component might be not a good idea. Also, since we already have |
I’m just thinking this would make it easier to share the common functionality, for things like radio-group and checkbox-group. But if you want to implement it separately for each element and have separate grouping wrappers, that’s fine by me. Maybe checkbox and radio-button should have And I wasn’t suggesting that we should remove any current functionality from existing elements. Though, |
@brp-oskar, btw, what would you expect to happen when a user clicks the ”Terms and conditions” label in your case? I’m expecting it to focus the checkbox, but not actually toggle it. |
I think a wrapper could be useful when creating own webcomponents (we combine two date pickers for a date range field, it would be useful to be able to add a label, required and invalid state for the combined field). Also for a phone number field (combined country picker and text field). How would the flow component be implemented with the wrapper? We need to be able to use the @jouni, I think only a focus is the best. A radio button group with a wrapper should only get focus, no select or click. |
I don’t have experience or good knowledge of Binder, but I would assume you can create a Flow component that exposes the contained components and their API so that you can access the value and invalid properties (in addition to the wrapper components properties). @Legioth can probably add more details. |
Oh, my question was just meant to be a hint that the solution, chosen for the client side, should also consider how to implement it with Flow (server side) . |
A value input component (aka |
label
property to align with other components?label
property?
This will be done in #2539 |
If we decide to introduce the
label
property we should define what will have a priority and probably throw a warning if both ways to set a label are used.The text was updated successfully, but these errors were encountered: