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 with lots of columns + setMinimumWidthFromContent + setHeightByRows fails with 8.12.0 #12139

Closed
mikke-alekstra opened this issue Oct 29, 2020 · 1 comment · Fixed by #12145
Labels

Comments

@mikke-alekstra
Copy link

Vaadin Framework version 8.12.0
Latest Chrome/Firefox browser versions
Liferay CE version 7.3.5 GA6

A grid with columns having setMinimumWithFromContent set to false to see ellipsis if content exceends column width.
So many columns that content exceends column width.
Grid's setHeightByRows set to exact number of data rows.

With Vaadin version <= 8.11.3 grid was shown as expected.
With 8.12.0 the grid is not shown, please wait spinner stays rolling.

Please see below a sample code that fails with 8.12.0 (and works with 8.11.3). 20 columns was well enough for my browser window size.

    @Override
    protected void init(VaadinRequest request) {
        
        Random random = new Random();
        
        List<DummyGridRow> gridRows = new ArrayList<DummyGridRow>();
        gridRows.add(new DummyGridRow(random));
        
        Grid<DummyGridRow> grid = new Grid<DummyGridRow>();
        for (int i = 0; i < 20; i++) {
            grid.addColumn(DummyGridRow::getValue)
            .setCaption("[" + i + "] Quite dummy column")
            .setMinimumWidthFromContent(false);
        }
        
        grid.setItems(gridRows);
        grid.setHeightByRows(gridRows.size());
        grid.setWidthFull();

        this.setContent(grid);
        
    }

    class DummyGridRow {
        
        private Random random = null;
        
        public DummyGridRow(Random random) {
            this.random = random;
        }
        
        public int getValue() {
            return this.random.nextInt(1000000000);
        }
        
    }

@TatuLund TatuLund added the bug label Oct 30, 2020
@TatuLund
Copy link
Contributor

I think it could be regression due #12058

Ansku added a commit to Ansku/framework that referenced this issue Nov 6, 2020
- ScrollbarBundle: removed delays in scroll handling that were only
needed for IE8, added possibility to update offsetSize and scrollSize at
the same time in order to avoid triggering unnecessary scrollbar
visibility change events during the intermediate state.
- ColumnConfigurator: added new method that allows setting column widths
without triggering element size recalculations.
- EscalatorProxy: added implementation of the new method to
ColumnConfigurationProxy.
- Escalator: switched to use new methods in ScrollbarBundle and
ColumnConfigurator, added a pixel to a scrollbar offsetSize calculation
that was for some reason consistently one pixel too low, removed
duplicate method calls from sectionHeightCalculated handling as those
are already handled by the calling method and can cause incorrect
intermediate state and unnecessary scrollbar visibility change events,
added implementation of the new method to ColumnConfigurationImpl with
the element size recalculations made optional.
- Grid: updated column minimum width calculations to take into account
the potential presence of a resize handle, updated expand ratio handling
to not trigger element size recalculations until the entire handling is
finished.
- Test for column width handling when there are multiple columns with
setMinimumWidthFromContent(false)

Fixes vaadin#12139
Ansku added a commit that referenced this issue Nov 10, 2020
- ScrollbarBundle: removed delays in scroll handling that were only
needed for IE8, added possibility to update offsetSize and scrollSize at
the same time in order to avoid triggering unnecessary scrollbar
visibility change events during the intermediate state.
- ColumnConfigurator: added new method that allows setting column widths
without triggering element size recalculations.
- EscalatorProxy: added implementation of the new method to
ColumnConfigurationProxy.
- Escalator: switched to use new methods in ScrollbarBundle and
ColumnConfigurator, added a pixel to a scrollbar offsetSize calculation
that was for some reason consistently one pixel too low, removed
duplicate method calls from sectionHeightCalculated handling as those
are already handled by the calling method and can cause incorrect
intermediate state and unnecessary scrollbar visibility change events,
added implementation of the new method to ColumnConfigurationImpl with
the element size recalculations made optional.
- Grid: updated column minimum width calculations to take into account
the potential presence of a resize handle, updated expand ratio handling
to not trigger element size recalculations until the entire handling is
finished.
- Test for column width handling when there are multiple columns with
setMinimumWidthFromContent(false)

Fixes #12139
Ansku added a commit that referenced this issue Dec 1, 2020
- ScrollbarBundle: removed delays in scroll handling that were only
needed for IE8, added possibility to update offsetSize and scrollSize at
the same time in order to avoid triggering unnecessary scrollbar
visibility change events during the intermediate state.
- ColumnConfigurator: added new method that allows setting column widths
without triggering element size recalculations.
- EscalatorProxy: added implementation of the new method to
ColumnConfigurationProxy.
- Escalator: switched to use new methods in ScrollbarBundle and
ColumnConfigurator, added a pixel to a scrollbar offsetSize calculation
that was for some reason consistently one pixel too low, removed
duplicate method calls from sectionHeightCalculated handling as those
are already handled by the calling method and can cause incorrect
intermediate state and unnecessary scrollbar visibility change events,
added implementation of the new method to ColumnConfigurationImpl with
the element size recalculations made optional.
- Grid: updated column minimum width calculations to take into account
the potential presence of a resize handle, updated expand ratio handling
to not trigger element size recalculations until the entire handling is
finished.
- Test for column width handling when there are multiple columns with
setMinimumWidthFromContent(false)

Fixes #12139
Ansku added a commit that referenced this issue Dec 1, 2020
- ScrollbarBundle: removed delays in scroll handling that were only
needed for IE8, added possibility to update offsetSize and scrollSize at
the same time in order to avoid triggering unnecessary scrollbar
visibility change events during the intermediate state.
- ColumnConfigurator: added new method that allows setting column widths
without triggering element size recalculations.
- EscalatorProxy: added implementation of the new method to
ColumnConfigurationProxy.
- Escalator: switched to use new methods in ScrollbarBundle and
ColumnConfigurator, added a pixel to a scrollbar offsetSize calculation
that was for some reason consistently one pixel too low, removed
duplicate method calls from sectionHeightCalculated handling as those
are already handled by the calling method and can cause incorrect
intermediate state and unnecessary scrollbar visibility change events,
added implementation of the new method to ColumnConfigurationImpl with
the element size recalculations made optional.
- Grid: updated column minimum width calculations to take into account
the potential presence of a resize handle, updated expand ratio handling
to not trigger element size recalculations until the entire handling is
finished.
- Test for column width handling when there are multiple columns with
setMinimumWidthFromContent(false)

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

Successfully merging a pull request may close this issue.

2 participants