Issue with Row Highlighting and Grid Cell Size in Vaadin Grid

Hi Team,

I am currently facing two issues with the Vaadin Grid:

  1. Row Highlighting Issue:
    When using the space key to click on a checkbox within a grid cell, only the checkbox itself gets highlighted, rather than the entire row. I am working with Vaadin version 23.3.35 and Java 11, and I have a single-select checkbox setup based on the row. I would appreciate any insights or solutions to ensure that the entire row is highlighted when the checkbox is selected. But in vaadin 14 was working correct.

  2. Grid Cell Size Issue:
    The size of the cells in the Vaadin Grid appears to be larger than expected. In Vaadin 14, the cell sizes were correct, but in Vaadin 23.3.35, they are being displayed in larger sizes by default. Can you help me understand why this change has occurred and how I can fix it?

Thanks,
Ashish Yadav

  1. Cannot reproduce this issue locally, in the docs, or in Vaadin+. Are you using SelectionMode?
grid.setSelectionMode(Grid.SelectionMode.MULTI);
  1. There are a few factors to take into account here. Grid cells don’t have a fixed height; instead, they have a minimum height (--lumo-size-m, which defaults to 36px). This means the row height will grow based on the content. Additionally, there is padding on vaadin-grid-cell-content, which wraps the cell content. Therefore, to adjust the cell height, you will need to do the following:
vaadin-grid::part(cell) {
  min-height: ...
}

vaadin-grid-cell-content {
  padding: ...
}

Unless I’ve missed something, that should be all.