You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I add a combo-box to my UI (Flow or Hilla) and enable custom-value, the value I type is not reflected to the value property in the element. See screenshot showing $0.value is empty:
If I select an item in the list, and write something in the input field, the item keeps checked, as it's shown in the screenshot:
Expected outcome
value is updated, and it has value in the element as well as in the flow component
Minimal reproducible example
Try this code
@state()
private items = ['Chrome', 'Edge', 'Firefox', 'Safari'];
protected override render() {
return html`
<vaadin-combo-box
allow-custom-value
label="Browser"
helper-text="Select or type a browser"
.items="${this.items}"
></vaadin-combo-box>
`;
}
UPD: this is actually how the Flow component works according to JavaDoc:
Note that ComboBox doesn't do anything with the custom value string automatically. Use the {@link #addCustomValueSetListener(ComponentEventListener)} method to determine how the custom value should be handled. For example, when the ComboBox has {@code String} as the value type, you can add a listener which sets the custom string as the value of the ComboBox with {@link #setValue(Object)}.
The second Flow example is doing exactly that using addCustomValueSetListener.
Description
value
property in the element. See screenshot showing$0.value
is empty:Expected outcome
value is updated, and it has value in the element as well as in the flow component
Minimal reproducible example
Try this code
Steps to reproduce
Show demo in the components documentation: https://vaadin.com/docs/latest/components/combo-box#custom-value-entry
Environment
Vaadin version(s): 24.5.0.alpha15, and most probably previous versions
Browsers
No response
The text was updated successfully, but these errors were encountered: