vaadin / framework

Vaadin 6, 7, 8 is a Java framework for modern Java web applications.
http://vaadin.com/
Other
1.78k stars 730 forks source link

TabSheet content inside nested FormLayout is not visible due wrong width #12611

Closed TatuLund closed 5 months ago

TatuLund commented 5 months ago

In complex nested FormLayout / TabSheet combination TabSheet fails to detect the child item width correctly, hence content wrapper element is set width of 0px. Due this content is not visible, although it is in the DOM.

See example view:

public class TabSheetView extends VerticalLayout implements View {
    public static final String NAME = "tabsheet";

    public TabSheetView() {
        FormLayout content = createContent();
        addComponent(content);
    }

    public FormLayout createContent() {
        TextField textField = new TextField(null, "Should be visible",
                ignore -> {
                });
        FormLayout layout = new FormLayout();
        TabSheet nestedTabSheet = new TabSheet(textField);
        nestedTabSheet.getTab(textField).setCaption("Nested");
        FormLayout nestedForm = new FormLayout(nestedTabSheet);
        TabSheet tabSheet = new TabSheet(nestedForm);
        tabSheet.getTab(nestedForm).setCaption("Main");
        layout.addComponent(tabSheet);
        return layout;
    }
}
thevaadinman commented 5 months ago

Fixed in 8.25.0