vaadin / flow-components

Java counterpart of Vaadin Web Components
100 stars 66 forks source link

Click on collapse/expand groups in spreadsheet with grouping behavior which used as primary component of SplitLayout cause invisible spreadsheet rows #6295

Open AndriiRevaEpicor opened 4 months ago

AndriiRevaEpicor commented 4 months ago

Description

When we want to use SplitLayout when Spreadsheet is primary component and some of another component will be as second component, and we want to use Excel file as complex Spreadsheet (bunch of data with some of frozen rows) with grouping behavior then after we clicked on the collapse/expand button all rows except frozen rows become invisible.

https://github.com/vaadin/flow-components/assets/167848338/3d7f7657-4161-49d6-989b-c8828c1d5323

If we try to click on collapse/expand button again the issue won't disappear.

Also, this bug reproduces when we move splitter closer to the spreadsheet (left) side and then click on collapse/expand button.

Temp workaround is, after refresh the browser tab to reset broken state, move splitter closer to opposite of the spreadsheet (right) side and after click on the collapse/expand button spreadsheet won't break.

NOTE: the same behavior was noticed on Vaadin 8.24.0 and Spreadsheet addon 2.1.1 (HorizontalSplitPanel with Spreadsheet as first component), (com.vaadin:vaadin-spreadsheet:2.1.1-dspanel / com.vaadin:vaadin-spreadsheet:2.1.1)

Added link to test project which help to reproduce this issue: https://github.com/AndriiRevaEpicor/vaadin24-spreadsheet-with-grouping-and-splitlayout-bug. Test Excel file (example.xlsx) lies in the test project's resource folder.

Expected outcome

I'd like to expect correctly expand/collapse behavior of complex Excel file when we use it within Spreadsheet as primary component in SplitLayout

Minimal reproducible example

    Spreadsheet spreadsheet;
    try (InputStream stream = new ClassPathResource("example.xlsx").getInputStream()) {
        spreadsheet = new Spreadsheet(stream);
    }

    Button button = new Button("Random button label");
    button.setSizeFull();

    SplitLayout splitLayout = new SplitLayout(spreadsheet, button, SplitLayout.Orientation.HORIZONTAL);
    splitLayout.setWidth("100%");
    splitLayout.setHeight("500px");

    add(splitLayout);

Steps to reproduce

  1. Run application.
  2. Try to collapse/expand group on the left side of SplitLayout on Spreadsheet.
  3. Make sure that rows except of header become invisible.

Environment

Vaadin version(s): 24.3.12 OS: Windows 11

Browsers

Chrome