Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grid renders too small and footer appears in random place initially #8023

Open
mstahv opened this issue Oct 24, 2024 · 1 comment
Open

Grid renders too small and footer appears in random place initially #8023

mstahv opened this issue Oct 24, 2024 · 1 comment

Comments

@mstahv
Copy link
Member

mstahv commented Oct 24, 2024

Description

If a column in a grid contains a vertical layout with a span, and all rows of grid are made visible, the initial height of the grid is too small and footer row can appear in weird place.

Expected outcome

Footer should be where footer should be, right from the start. Not like this:

Screenflick.Movie.94.mp4

Minimal reproducible example

package org.vaadin.example;

import com.vaadin.flow.component.grid.FooterRow;
import com.vaadin.flow.component.grid.Grid;
import com.vaadin.flow.component.html.Paragraph;
import com.vaadin.flow.component.html.Span;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.router.Route;

import java.util.List;
import java.util.stream.IntStream;

/**
 * A sample Vaadin view class.
 */
@Route
public class MainView extends VerticalLayout {

    public MainView() {

        Grid<String> grid = new Grid<>();
        Grid.Column<String> str = grid.addColumn(s -> s).setHeader("STR");
        grid.addComponentColumn(s -> {
                    VerticalLayout cellLayout = new VerticalLayout();
                    cellLayout.add(new Span("ORG1A"));
                    return cellLayout;
                });

        List<String> list = IntStream.rangeClosed(1, 15).mapToObj(i -> "" + i).toList();
        grid.setItems(list);

        grid.setAllRowsVisible(true);

        FooterRow footerRow = grid.prependFooterRow();
        footerRow.getCell(str).setComponent(new Paragraph("It works!"));

        add(grid);
    }
}

Steps to reproduce

Open the example view and start scrolling easily to see the footer in wrong place.

Environment

Vaadin version(s): 24.5.1
OS: mac, all browsers

Browsers

No response

@jorgheymans
Copy link

Our client is also impacted by this , and would appreciate a fix if possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants