Window resized by TabSheet, can get cut off
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.8k
- Forks
- 717
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 3
Description
Originally by mdiamond
I have a tabsheet in a sub-window. If the browser window is too small for it when the window is first brought up, switching tabs can cause the window to recalculate its size incorrectly.
Steps to repro (using the DemoWindow code below):
- Resize the browser to be too small to show the whole sub-window.
- Call up the sub-window.
- Note that the sub-window's bottom corners are rounded, showing that the window has sized itself correctly to the browser window. The scrollbar can be used to see all controls.
- Click on the second tab; the scrollbar disappears (as expected).
- Click back to the first tab.
- BUG: The bottom of the sub-window is now cut-off. The scrollbar cannot be used to see all controls.
- Maximize the window, then restore it. The window size is correct once more, and switching tabs does NOT change its size any more.
public class DemoWindow extends Window {
static private float PIXEL_WIDTH = 400f;
static private float PIXEL_HEIGHT = 500f;
public DemoWindow() {
super("Demo Window");
FormLayout layoutTab1 = new FormLayout();
for (int i = 0; i < 20; i++) {
layoutTab1.addComponent(new TextField("Field " + i));
}
layoutTab1.setMargin(true);
layoutTab1.setSizeFull();
FormLayout layoutTab2 = new FormLayout();
layoutTab2.setMargin(true);
layoutTab2.setSizeFull();
TabSheet tabControl = new TabSheet();
tabControl.addTab(layoutTab1, "Tab 1");
tabControl.addTab(layoutTab2, "Tab 2");
tabControl.addStyleName(ValoTheme.TABSHEET_FRAMED);
tabControl.addStyleName(ValoTheme.TABSHEET_PADDED_TABBAR);
tabControl.setSizeUndefined();
VerticalLayout outerFrame = new VerticalLayout();
outerFrame.addComponent(tabControl);
outerFrame.setSizeUndefined(); // must be Undefined to get window's scroll bars to appear
setContent(outerFrame);
setModal(true);
setWidth(PIXEL_WIDTH, Unit.PIXELS);
setHeight(PIXEL_HEIGHT, Unit.PIXELS);
}
}
Imported from https://dev.vaadin.com/ issue #15180
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the DemoWindow reproduction described in the issue, focusing on Window, TabSheet, and the sizing behavior when switching between tabs. Verify the case where the browser is too small and the window initially shows scrollbars. Done means switching tabs no longer cuts off the sub-window, and maximizing then restoring is not required to correct its size.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100