@HtmlImport("frontend://customhtml/custom-combobox.html")
public class CustomComboBox extends ComboBox<String> {
public CustomComboBox() {
setId("custom-combobox");
}
}
Firstly, your dom module has theme-for="vaadin-text-field", while you’re creating a theme for vaadin-combo-box.
Another issue is that the element id you add with setId in Java code isn’t the same as the <dom-module id= attribute as you’re probably expecting here.
I would rather use setClassName("custom-combobox"); in the Java component and
<style>
:host(.custom-combobox) [part="text-field"]
{ // :host() is the root element, that is `<vaadin-combo-box>`
// styles targeting the 'text-field' part of all comboboxes with the 'custom-combobox' class
}
Olli Tietäväinen:
I see a couple of potential problems here.
Firstly, your dom module has theme-for="vaadin-text-field", while you’re creating a theme for vaadin-combo-box.
Another issue is that the element id you add with setId in Java code isn’t the same as the <dom-module id= attribute as you’re probably expecting here.
I would rather use setClassName("custom-combobox"); in the Java component and
Olli Tietäväinen:
I see a couple of potential problems here.
Firstly, your dom module has theme-for="vaadin-text-field", while you’re creating a theme for vaadin-combo-box.
Another issue is that the element id you add with setId in Java code isn’t the same as the <dom-module id= attribute as you’re probably expecting here.
I would rather use setClassName("custom-combobox"); in the Java component and