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 joined columns misplaced when a flexgrow + zero width column exists #6848

Open
mikhail-barg opened this issue Nov 21, 2024 · 0 comments

Comments

@mikhail-barg
Copy link

Description

I'm prepending a "spacing" column to a grid with joined columns, and it breaks the joined header row.

Looks like this:
Screenshot 2024-11-21 232339_
Screenshot 2024-11-21 232347

Expected outcome

If I remove the .setWidth("0") line on the "Z" column, it looks as expected:
Screenshot 2024-11-21 232318

Minimal reproducible example

@Route("")
public class MainView extends VerticalLayout {

    public final class Dto {
        public String get() { return "value"; }
    }

    public MainView() {

        Grid<Dto> grid = new Grid<>();
        grid.prependHeaderRow(); //initial header
        HeaderRow groupHeaderRow = grid.prependHeaderRow();

        Grid.Column<Dto> z = grid.addColumn(Dto::get)
            .setHeader("Col Z")
            .setWidth("0")      //this line!
            .setFlexGrow(1);
        Grid.Column<Dto> a = grid.addColumn(Dto::get).setHeader("Col A");
        Grid.Column<Dto> b = grid.addColumn(Dto::get).setHeader("Col B");
        groupHeaderRow.join(a, b).setText("Join");

        grid.setSizeFull();
        grid.addThemeVariants(GridVariant.LUMO_COLUMN_BORDERS);
        this.setSizeFull();
        this.add(grid);
    }
}

Steps to reproduce

just run it

Environment

Vaadin version(s): checked on 24.5.5, 24.4.6
OS: Windows 11
Browser: Chrome 131.0.6778.70

Browsers

Chrome, Edge, Issue is not browser related

@yuriy-fix yuriy-fix changed the title Grid joined columns misplaced when a flexgrow + zero whdth column exists Grid joined columns misplaced when a flexgrow + zero width column exists Nov 28, 2024
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

2 participants