vaadin / multiplatform-runtime

4 stars 1 forks source link

mpr-v7 table column selector positioned wrongly when the table is bottom of tall view #71

Closed johannest closed 4 years ago

johannest commented 4 years ago

Vaadin 7.7.17 Platform 14.1.19 (also tested with 13) mpr-v7 2.0.3 Chrome & Firefox (at least)

When there is a tall view in small browser window such that the table in a legacy wrapped layout has to be scrolled into the viewport. Then, opening the column selector of the table shows the context menu with significant offset from the column menu button. See the screenshot below:

image

Demo application to reproduce the issue

@Route("")
@MprTheme("mytheme")
@MprWidgetset("org.vaadin.mprdemo.MyWidgetSet")
public class MyUI extends FlexLayout {

    public MyUI () {
        final VerticalLayout layout = new VerticalLayout();
        layout.setSizeFull();
        Table table = new Table("The Brightest Stars");
        table.addContainerProperty("Name", String.class, null);
        table.addContainerProperty("Mag",  Float.class, null);

        Object newItemId = table.addItem();
        Item row1 = table.getItem(newItemId);
        row1.getItemProperty("Name").setValue("Sirius");
        row1.getItemProperty("Mag").setValue(-1.46f);

        table.addItem(new Object[]{"Canopus",        -0.72f}, 2);
        table.addItem(new Object[]{"Arcturus",       -0.04f}, 3);
        table.addItem(new Object[]{"Alpha Centauri", -0.01f}, 4);
        table.setPageLength(table.size());
        table.setColumnCollapsingAllowed(true);

        VerticalLayout testLo = new VerticalLayout();
        testLo.setHeight("1500px");

        layout.addComponents(testLo, table);
        add(new LegacyWrapper(layout));
    }
}
mehdi-vaadin commented 4 years ago

The bug is on V7 side. It will be fixed by https://github.com/vaadin/framework/pull/11946. See the PR for more info.

mehdi-vaadin commented 4 years ago

https://github.com/vaadin/framework/pull/11946 has been merged and I'm closing this issue.