FormLayout width depends on the number of rows it contains; goes to 100% with 3 or more rows
See original GitHub issueThis issue prevents the FormLayout to have undefined width. When the width of the layout is not defined, it correctly fits the content with a single row of fields it contains. Adding another rows increases the width of the layout and the third row always makes the layout extend to 100%. You can see this behavior in the series of attached snapshots. It is easily reproduced with the code below, please comment out fields to see how it changes the width of the layout.
`public class FormTestView extends VerticalLayout {
public FormTestView() {
addFormLayout();
}
private void addFormLayout() {
FormLayout form = new FormLayout();
add( form );
TextField firstName = new TextField();
form.addFormItem( firstName, "First Name" );
TextField lastName = new TextField();
form.addFormItem( lastName, "Last Name" );
TextField email = new TextField();
form.addFormItem( email, "Email" );
firstName = new TextField();
form.addFormItem( firstName, "First Name 2" );
lastName = new TextField();
form.addFormItem( lastName, "Last Name 2" );
email = new TextField();
form.addFormItem( email, "Email 2" );
}
} `
Versions: - Vaadin / Flow - 12.0.3 - Java version - 1.8.0_172 - OS version - Windows 10 Pro - Chrome - 71.0.3578.98 (Official Build) (64-bit)
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
FormLayout inside VerticalLayout changes its width ... - GitHub
FormLayout width depends on the number of rows it contains; goes to 100% with 3 or more rows vaadin/flow#4924.
Read more >grid-auto-rows - CSS: Cascading Style Sheets - MDN Web Docs
The grid-auto-rows CSS property specifies the size of an implicitly-created grid row track or pattern of tracks.
Read more >Setting Form Layout
When you create forms, the Layout tab initially contains one row and one column, and all dimensions are in Point of View. When...
Read more >CSS · Bootstrap
Predefined grid classes like .row and .col-xs-4 are available for quickly making ... Inputs and selects have width: 100%; applied by default in...
Read more >Mig Layout White Paper
Size Groups. Sometimes there is the need for components/columns/rows to have the same width and/or height. This is easily done with size groups....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That’s true.
I will try to enforce work on it. Though this is another team.
Thank you!