When creating a Popover dynamically and calling open() without adding to the UI while the target is inside Dialog, the vaadin-popover instance is attached to vaadin-dialog-overlay but the opened property is not set to true.
Note: the problem occurs on first click. On subsequent clicks, new popover instance is added and opened.
Expected outcome
Expected Popover to open.
Minimal reproducible example
public class PopoverDialogPage extends Div {
public PopoverDialogPage() {
NativeButton button = new NativeButton("Show popover");
button.addClickListener(evt -> {
Popover popover = new Popover();
popover.add("Sample popover text.");
popover.setTarget(button);
popover.open(); // Problem here: nothing happens.
});
Dialog dialog = new Dialog("Demo dialog", button);
dialog.open();
}
}
Steps to reproduce
Run the above code and click the button in the Dialog.
Description
Originally reported at https://vaadin.com/forum/t/popover-within-dialog/167818
When creating a Popover dynamically and calling
open()
without adding to the UI while the target is inside Dialog, thevaadin-popover
instance is attached tovaadin-dialog-overlay
but theopened
property is not set totrue
.Note: the problem occurs on first click. On subsequent clicks, new popover instance is added and opened.
Expected outcome
Expected Popover to open.
Minimal reproducible example
Steps to reproduce
Run the above code and click the button in the Dialog.
Environment
Vaadin version(s): 24.5, 24.6
Browsers
Issue is not browser related