weixin_39927799 2020-11-30 08:55
浏览 0

Window size (height) not adjusted to content

Originally by shinchillahh

I got a com.vaadin.ui.Window with a fixed width (setWidth(600, Unit.PIXELS)). Now I'm adding three com.vaadin.ui.TextField and one com.vaadin.ui.Panel with a fixed height (panel.setHeight(350, Unit.PIXELS)). Finally I'm adding two com.vaadin.ui.Button.

I thought that the Window takes the height of it's components... So the height of the TextFields + the Panel + the two Buttons. That works until I add big content in the 350 Pixels Panel. The Panel size is fixed, so the vertical scrollbar appears next to the panel but the window sets it's height to the maximum of the browser window (953 Pixels). The content of the Window has still the right size but the Window adds some white space at the bottom of the Window. Now if I change the position of the window (a simple drag), or if I'm pressing on a Button in the Window without a Clicklistener(!) the Window adjust it's size and everything is fine.

I think that the Window computes the height of its content and doesn't notice that the panel has a fixed size. If the Panel has an height of 1000 Pixels (theoretically, without overflow) the window tries to adjust its height to the combined height of all components.

Imported from https://dev.vaadin.com/ issue #19590

该提问来源于开源项目:vaadin/framework

  • 写回答

6条回答 默认 最新

  • weixin_39927799 2020-11-30 08:55
    关注

    Originally by proaccountapp

    Updated prioritization date.

    评论

报告相同问题?