Combobox with custom values fails required validation

Latest 13-series. If I have a Combobox that allows custom values and I type something into it I see the required indicator disappear. If I however trigger the bound binder.validate(), I get the required message. Known bug or am I doing something wrong? If I pick a value from the list, validation passes.

I’m still seeing this issue on 14.0.0 rc7

I’m facing the same problem recently. I don’t use binder. But, here’s what I do to resolve it. I add the following code prior saving my data:

		if (rating.getValue() == null) {
            String s = rating.getElement().getProperty("value");
            if (s != null) {
                listRating.add(s.trim());
                rating.setItems(listRating);
                rating.setValue(s.trim());
            }
        }

But this workaround has it’s own drawback. It’s only working when list item is not an empty array. So, be carefull with list items, at least you have to add one ‘-’ item, since empty string will not work.

comboBox.addCustomValueSetListener(event -> {
	comboBox.setValue(event.getDetail());
});

Add this and it should work.

This is still an issue in Vaadin 18.0.7…

Had to use the workaround suggested by Joel with a slight change:

combo.addCustomValueSetListener(event -> {
	combo.setValue(((CustomValueSetEvent)event).getDetail());
});