Skip to content

[details] Notify resize on toggling opened state to redraw vaadin-board in details #618

@danieltalebi

Description

@danieltalebi

Creating a Board inside a collapse Details causes the Board not to expand correctly when the Details is opened. The elements are stacked on top of each other instead of displaying them in rows.

    public MainView() {
        final Board board = new Board();
        board.addRow(new TextField("Field1"), new TextField("Field2"), new TextField("Field3"), new TextField("Field4"));
        board.addRow(new ComboBox<String>("Combo1"), new ComboBox<String>("Combo2"), new ComboBox<String>("Combo3"), new ComboBox<String>("Combo4"));
        Details details = new Details("Expand me!", board);
        details.getElement().getStyle().set("width", "100%");
        add(details);
    }

A workaround we are using

    details.addOpenedChangeListener(event -> {
            if (event.isFromClient() && event.isOpened()) {
                board.redraw();
            }
        });

If the Details is opened, the Board gets the right width.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions