vaadin / web-components

A set of high-quality standards based web components for enterprise web applications. Part of Vaadin 20+
https://vaadin.com/docs/latest/components
470 stars 83 forks source link

[crud] Editor dialog cannot handle too large layouts #732

Closed stefanuebe closed 2 years ago

stefanuebe commented 4 years ago

Not sure why that happens, but having a vertical layout with multiple text fields leads to an "inner" scroll bars to scroll the edit area (expected) and also to an "outer" scroll bar, that scrolls the dialog area including the toolbar (not expected) - see screenshot 1.

When the dialog is in "fullscreen mode" due to a small window, it is displayed correctly (screenshot 2).

Example issue code (Java)

@Route("issue")
public class IssueView extends VerticalLayout {

    public IssueView() {
        VerticalLayout layout = new VerticalLayout();

        for (int i = 0; i < 30; i++) {
            layout.add(new TextField("Test " + i));
        }

        BinderCrudEditor<String> editor = new BinderCrudEditor<>(new Binder<>(String.class), layout);

        Grid<String> grid = new CrudGrid<>(String.class, false);
        grid.removeAllColumns();
        grid.addColumn(s -> s).setHeader("String");
        Crud.addEditColumn(grid);

        Crud<String> crud = new Crud<>(String.class, grid, editor);
        crud.setDataProvider(DataProvider.fromCallbacks(q -> Stream.of("1", "2", "3"), q -> 3));
        add(crud);
    }
}

Screenshots

Screenshot 1 image

Screenshot 2 image

rolandoisidoro commented 4 years ago

This "double vertical scrollbar" issue occurs only when using the OVERLAY (default) crud editor position, one scrollbar relates to the form slot and the other to the footer slot.

Both on ASIDE and BOTTOM positions the component only show the scrollbar for the form slot, as expected.

This is particular problematic for the following scenarios:

  1. Forms with a high number of field rows;
  2. Forms with a regular number of field rows but on screen resolutions with lower height values. Ex:. a form with 6 rows on HD 1366x768px resolution (one of the most used on laptops), already shows an unwanted scrollbar;
  3. Forms with field validations. Validation messages being shown result on an increased height for a component, from 77px to 103.65px, which reduces the number of fields needed to trigger the issue.
web-padawan commented 2 years ago

Tested with Vaadin 14.8, 22 and 23 and I can't reproduce this with the code provided - only one scroll bar is shown:

Screenshot 2022-04-26 at 14 35 46

Closing this for now. Please submit a new issue with code example to reproduce if you still face this problem.