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
{{ message }}
Repository navigation
Calling Dialog::removeAll destroys interaction with header and footer of a dialog #5263
Title says it all. Once Dialog::removeAllis called, any action e.g. Button click from a button within the dialog's header or footer is not reaching the server anymore.
Expected outcome
Dialog::removeAll should NOT interfere with the header and footer feature of the grid.
Minimal reproducible example
newButton("Open Dialog", e -> {
AtomicReference<Dialog> reference = newAtomicReference<>();
vardialog = newDialog();
reference.set(dialog);
dialog.getFooter().add(newButton("Click me after clear", ex -> {
System.out.println("Was I called? :(");
}));
dialog.add(newButton("Click me to clear dialog", event -> {
reference.get().removeAll();
reference.get().add(newParagraph("I was cleared!"));
}));
dialog.open();
})
changed the title [-]Calling `Dialog::removeAll` destroy interaction with header and footer of a dialog[/-][+]Calling `Dialog::removeAll` destroys interaction with header and footer of a dialog[/+]on Jul 17, 2023
Agree, removeAll (and similar HasComponents methods) should only affect the content area, not elements in the title, header-content or footer slots.
**Edit: ** This gets tricky as there are a lot of methods from various interfaces that act on the Dialog's child elements in general. Need to research the best approach here.
This adds the header / footer wrapper elements as a direct children of the dialog, which also means they will be removed there when calling removeAll. This also affects other APIs in the dialog such as getChildren, getChildCount and addComponentAtIndex.
One thing to try would be to add the wrappers as virtual children instead.
Activity
[-]Calling `Dialog::removeAll` destroy interaction with header and footer of a dialog[/-][+]Calling `Dialog::removeAll` destroys interaction with header and footer of a dialog[/+]knoobie commentedon Jul 19, 2023
Workaround:
rolfsmeds commentedon Jul 19, 2023
Agree, removeAll (and similar
HasComponentsmethods) should only affect the content area, not elements in thetitle,header-contentorfooterslots.**Edit: ** This gets tricky as there are a lot of methods from various interfaces that act on the Dialog's child elements in general. Need to research the best approach here.
rolfsmeds commentedon Jul 19, 2023
Should also check if ConfirmDialog is broken in a corresponding way.
sissbruecker commentedon Jul 19, 2023
This part looks suspicious:
flow-components/vaadin-dialog-flow-parent/vaadin-dialog-flow/src/main/java/com/vaadin/flow/component/dialog/Dialog.java
Line 696 in 832d0ea
This adds the header / footer wrapper elements as a direct children of the dialog, which also means they will be removed there when calling
removeAll. This also affects other APIs in the dialog such asgetChildren,getChildCountandaddComponentAtIndex.One thing to try would be to add the wrappers as virtual children instead.
knoobie commentedon Dec 2, 2025
How can the exact bug be re-introduced in V25? My example from above is broken again.. Luckily I've written a test to verify it.. :( @rolfsmeds
knoobie commentedon Dec 2, 2025
Funny thing - it's even more broken. In the past the footer/header was still visible - now the dialog is empty and broken
knoobie commentedon Dec 2, 2025
Workaround:
web-padawan commentedon Dec 2, 2025
@knoobie Could you please create a new issue for this problem? We are typically using new tickets for regressions.
knoobie commentedon Dec 2, 2025
Done: #8315