Grid height should not default to 10 rows when height is undefined
Open
Nobody has claimed this yet.
enhancement
workaround
- Dominant language
- Java
- Stars
- 1.8k
- Forks
- 717
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 3
Description
To make sure we can quickly validate and fix the bug, please provide as much as possible of the following information:
- Vaadin Framework version (e.g. 8.3.1)
8.3.2 - Browser version
Chrome 65 - Web container name and version
Tomcat 8.5.29 - Description of the bug
I have many grids and I want them to expand depending on number of rows and the grids have undefined height; however, for grids with fewer than the default 10 rows I get a bunch of empty white space taking up valuable real estate on the screen. This default seems to coincide with a 1px border and 38px row height, as reported by Chrome, and the default grid with unspecified height is 400px high or (38 + 1 top + 1 bottom) * 10. - Minimal reproducible example
Create a grid with full width and undefined height. Add for example 2 rows and add to UI. - Expected behavior
Only required space would be utilized. - Actual behavior
Grid body defaults to 400px high leaving a bunch of white space.
One workaround is to query the DataProvider for it's size then call setHeightByRows(size) on the grid
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the minimal reproduction: create a full-width grid with undefined height and two rows, then inspect the resulting 400px height. Compare that behavior with the expected space needed for the rows and the documented setHeightByRows(size) workaround. Done means an undefined-height grid sizes itself to its row content without the default ten-row whitespace.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100