diff --git a/articles/tools/mpr/configuration/limitations.adoc b/articles/tools/mpr/configuration/limitations.adoc index 08204812ad..57672b539e 100644 --- a/articles/tools/mpr/configuration/limitations.adoc +++ b/articles/tools/mpr/configuration/limitations.adoc @@ -123,6 +123,29 @@ Z-indexes of the modern Vaadin Design System aren't aligned with legacy. Compone For example, using such Vaadin 7 and 8 components with LegacyWrapper in Dialog may not work as expected. +== Legacy Components & Modal Dialogs + +Legacy component events don't work unless you disable server-side modality of the Dialog component. You can do that after the Dialog component has been opened. + +[source,java] +---- + Dialog dialog = new Dialog(); + dialog.setHeaderTitle("Dialog"); + dialog.add(new Label("Hello")); + // Using legacy button + LegacyWrapper wrapper = new LegacyWrapper(new Button("Close", e -> { + dialog.close(); + })); + dialog.addOpenedChangeListener(e -> { + if (e.isOpened()) { + UI.getCurrent().setChildComponentModal(dialog, false); + } + }); + dialog.getFooter().add(wrapper); + // Dialog needs to be added to layout + add(dialog); +---- + <<../overview#,>