vaadin / vaadin/framework

Allow fill-parent/wrap-content paradox in certain cases

Open
#9,284 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Please see the following situation:

fillparentwrapcontent-current

The VerticalLayout's width is null and thus it wraps its children; all buttons have their widths set to 100%. This seemingly creates the fill-parent/wrap-content paradox; Vaadin's VerticalLayout resolves this by acting as if all button widths were null and will wrap them.

However, often it is desirable to have all buttons share the width of the widest one. In Android this case has been made to work properly: http://stackoverflow.com/questions/4606613/combining-wrap-content-on-parent-and-fill-parent-on-child - in such case a widest button is found and all other buttons will be made as wide as the widest button.

Current workaround is to mark the widest button with width being null, leaving other buttons having 100% width. This works properly with VerticalLayout. It would be great if VerticalLayout could support also the all-children-having-100% width case.

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 with VerticalLayout's width and child-measurement behavior, using the described all-children-100% case as the reproduction. Compare it with the existing behavior when the widest child has a null width. Done means a wrapping VerticalLayout can determine the widest button and apply that width consistently without requiring a manual workaround.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.