question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FormLayout width depends on the number of rows it contains; goes to 100% with 3 or more rows

See original GitHub issue

This 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)

1row 2rows 3rows

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
denis-anisimovcommented, Jan 18, 2019

That sucks!

That’s true.

I will try to enforce work on it. Though this is another team.

0reactions
sergetaniacommented, Jan 21, 2019

Thank you!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found