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
ComboBox calls CustomValueSetListener twice if a dialog is opened in the listener
Expected outcome
CustomValueSetListener is called once
Actual outcome
ComboBox calls CustomValueSetListener twice
Minimal reproducible example
package com.mycompany.v22.test;
import com.vaadin.flow.component.button.Button;
import com.vaadin.flow.component.combobox.ComboBox;
import com.vaadin.flow.component.dialog.Dialog;
import com.vaadin.flow.component.html.Span;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.router.Route;
@Route
public class MainView extends VerticalLayout {
private int dialogCounter = 1;
public MainView() {
ComboBox<String> cb = new ComboBox<>();
cb.setLabel("Type something and hit enter");
cb.addCustomValueSetListener(cv -> {
System.err.println("WTF, i'm called twice ? " + cv.getDetail());
Dialog d2 = new Dialog();
d2.add(new Span("Dialog " + dialogCounter));
dialogCounter++;
Button save = new Button("Close");
save.addClickListener(e1 -> {
d2.close();
});
d2.add(save);
d2.open();
});
add(cb);
}
}
Steps to reproduce
Use the example code, type something to field and hit enter. You'll see two dialogs opened instead of one.
Environment
Vaadin
22.0.2
Flow
9.0.2
Java
Eclipse Adoptium 17
OS
aarch64 Mac OS X 12.0.1
Browser
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36
Activity
web-padawan commentedon Feb 21, 2022
Duplicate of #2285.
web-padawan commentedon Feb 21, 2022
Reopened as this appears to be a problem in the web component different from #2285.
web-padawan commentedon Feb 22, 2022
The fix caused a regression in
TimePickerand will be reverted. Reopening this until we find a better fix.