-
Notifications
You must be signed in to change notification settings - Fork 87
Open
Labels
Description
Allowing to pass arbitrary types to children elements would enable support for element like vaadin-checkbox-group
. Note that this feature will also fix vaadin/vaadin-custom-field#76
This works
@customElement('vaadin-custom-view2')
export class VaadinCustomView extends LitElement {
@query('#field1') field1: any;
async updated() {
this.field1.value = ['1', '3'];
}
render() {
console.log("render")
return html`
<vaadin-checkbox-group id="field1">
<vaadin-checkbox value="1">foo</vaadin-checkbox>
<vaadin-checkbox value="2">bar</vaadin-checkbox>
<vaadin-checkbox value="3">baz</vaadin-checkbox>
</vaadin-checkbox-group>
`;
}
}
But this does not work
@customElement('vaadin-custom-view2')
export class VaadinCustomView extends LitElement {
@query('#field1') field1: any;
async updated() {
this.field1.value = ['1', '3'];
}
render() {
console.log("render")
return html`
<vaadin-custom-field id="field1">
<vaadin-checkbox-group>
<vaadin-checkbox value="1">foo</vaadin-checkbox>
<vaadin-checkbox value="2">bar</vaadin-checkbox>
<vaadin-checkbox value="3">baz</vaadin-checkbox>
</vaadin-checkbox-group>
</vaadin-custom-field>
`;
}
}
jcgueriaud1, markhm and robert-bor