- 
                Notifications
    
You must be signed in to change notification settings  - Fork 0
 
Description
Vaadin platform 22.0.28 / Vaadin framework: 8.20.0 (with compatibility mode) /MPR: 5.0.10
The following class contains some Vaadin 22 components and some Vaadin 8 components. When setting expand ratio to legacy table component, the view shows a vertical scroll bar that should not appear.
import com.vaadin.flow.component.button.Button;
import com.vaadin.flow.component.checkbox.Checkbox;
import com.vaadin.flow.component.html.Div;
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.router.Route;
import com.vaadin.mpr.LegacyWrapper;
import com.vaadin.ui.TextField;
import com.vaadin.v7.ui.Table;
@Route("")
public class UITest extends VerticalLayout {
    public UITest() {
        // Legacy view
        TextField field = new TextField();
        Table table = new Table();
        table.setSizeFull();
        com.vaadin.ui.VerticalLayout layout = new com.vaadin.ui.VerticalLayout();
        layout.setSizeFull();
        layout.setSpacing(false);
        layout.addComponents(field, table);
        // Flow components
        LegacyWrapper wrapper = new LegacyWrapper(layout);
        wrapper.setSizeFull();
        Div legacyLayout = new Div();
        legacyLayout.setSizeFull();
        legacyLayout.getElement().getStyle().set("background", "lightgray");
        Button addView = new Button("Add view");
        addView.addClickListener(click -> legacyLayout.add(wrapper));
        Button removeView = new Button("Remove view");
        removeView.addClickListener(click -> legacyLayout.remove(wrapper));
        Checkbox setExpand = new Checkbox("Set expand ratio to table");
        setExpand.addValueChangeListener(change -> {
            if (change.getValue()) {
                layout.setExpandRatio(table, 1);
            } else {
                layout.setExpandRatio(table, 0);
            }
        });
        HorizontalLayout buttonLayout = new HorizontalLayout();
        buttonLayout.setPadding(false);
        buttonLayout.add(addView, removeView, setExpand);
        add(buttonLayout);
        add(legacyLayout);
        setSizeFull();
        setSpacing(false);
        setPadding(false);
        setMargin(false);
        setFlexGrow(1, legacyLayout);
    }
}Steps to reproduce:
1 - Click "Add View" button to add the legacy components and you can see a small overflow in browser. Then click checkbox to set expand ratio to table, overflow increases and Vaadin Debug Window show several "ResizeObserver loop limit exceeded (http://localhost:8080/:0:0)" notification messages.
2 - Click "Remove View" button to remove the legacy components leaving the expand ratio checkbox checked. Then click "Add View" button again and overflow is still there.
Tried different approaches like adding legacyLayout.getStyle().set("display", "flex"); or wrapper.getStyle().remove("display"); that make step 1 to lose the overflow but they don't work on step 2. When expand ratio is already set before adding the legacy components, the scroll appears.
