vaadin / vaadin/framework

8.2 height calculation error

Open
#10,185 12 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Stale workaround
Dominant language
Java
Stars
1.8k
Forks
717
Avg merge
2d 6h
Merged PRs (30d)
3

Description

HorizontalLayouts which have no components in them have non-zero height, but apparently aren't included in height calculation, which causes issues with calculating the height of expanding components.

Sample:

public class LayoutCalculation extends VerticalLayout {

    public LayoutCalculation() {
        setSizeFull();
        addComponent(new HorizontalLayout());
        Panel p = new Panel();
        p.setSizeFull();
        addComponent(p);
        setExpandRatio(p, 1.0f);
        addComponent(new HorizontalLayout());
        addComponent(new Button("TEST"));
    }

}

The button will be rendered partially outside the screen.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the LayoutCalculation sample with empty HorizontalLayout instances, an expanding Panel, and the Button. Trace the layout height-calculation entry points for HorizontalLayout and VerticalLayout; done means empty horizontal layouts contribute their non-zero height and the sample renders the Button fully within the screen.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.