Size Dialog ?

Hello guys, I’m not defining the size of the Dialogue, but I need to know the size of it … however, when I give a “getheight”, it returns null, could someone help me?

Vaadin 16.0.0

One way of getting the Dialog size is through JavaScript. Something like,

Page page = UI.getCurrent().getPage();
page.executeJs("return document.getElementById('overlay').shadowRoot.getElementById('overlay').clientHeight")
		.then(result -> System.out.println(
				"Dialog height in px: " + result.asString()));

For dialog resize events, no JS is needed since the API provides access to the dialog size. For example,

dialog.addResizeListener(event -> System.out.println(event.getHeight()));

Thank you very much, … it worked