Description
When grid is visible from the start,
the table header row is marked with aria-rowindex="1"
the first row of the table body starts with aria-rowindex="2"

When grid is hidden, and then revealed,
the table header row is marked with aria-rowindex="1"
the first row of the table body starts with aria-rowindex="1"
there is no row with aria-rowindex="4" it skips directly to aria-rowindex="5"
if you have scroll, and scroll to the bottom, back to the top, the first row of the table body aria-rowindex="2", and the second row is also aria-rowindex="2"

Expected outcome
Table header row is marked with aria-rowindex="1"
First row of the table body starts with aria-rowindex="2"
It doesn't skip aria-rowindex="4"
Minimal reproducible example
import com.vaadin.flow.component.button.Button;
import com.vaadin.flow.component.dependency.Uses;
import com.vaadin.flow.component.grid.Grid;
import com.vaadin.flow.component.icon.Icon;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.router.Menu;
import com.vaadin.flow.router.PageTitle;
import com.vaadin.flow.router.Route;
import jakarta.annotation.security.PermitAll;
import org.vaadin.lineawesome.LineAwesomeIconUrl;
import java.util.List;
@PageTitle("Two Grids")
@Route("two-grids")
@Menu(order = 4, icon = LineAwesomeIconUrl.TABLE_SOLID)
@PermitAll
@Uses(Icon.class)
public class TwoGrids extends VerticalLayout {
private Grid<String> grid1;
private Grid<String> grid2;
public TwoGrids() {
grid1 = createRegularGrid();
grid2 = createRegularGrid();
grid2.setVisible(false);
var button = new Button("Toggle grid 2");
button.addClickListener(event -> grid2.setVisible(!grid2.isVisible()));
add(grid1, button, grid2);
}
private Grid<String> createRegularGrid() {
var grid = new Grid<String>();
grid.addColumn(String::toString)
.setHeader("Regular");
grid.setItems(exampleValues());
return grid;
}
private List<String> exampleValues() {
return List.of("One", "Two", "Three", "Four", "Five");
}
}
Steps to reproduce
- Create two identical grids.
- Hide one of them initially.
- After view has been loaded, reveal the grid that was hidden.
- Verify in the revealed grids shadowdom its
aria-rowindex situation.
- Compare it with the grid that was initially visible to see the inconsistency.
Environment
Vaadin version(s): 24.7.3
OS: Linux Mint
Browsers
Firefox, Chrome
Description
When grid is visible from the start,

the table header row is marked with
aria-rowindex="1"the first row of the table body starts with
aria-rowindex="2"When grid is hidden, and then revealed,

the table header row is marked with
aria-rowindex="1"the first row of the table body starts with
aria-rowindex="1"there is no row with
aria-rowindex="4"it skips directly toaria-rowindex="5"if you have scroll, and scroll to the bottom, back to the top, the first row of the table body
aria-rowindex="2", and the second row is alsoaria-rowindex="2"Expected outcome
Table header row is marked with aria-rowindex="1"
First row of the table body starts with aria-rowindex="2"
It doesn't skip
aria-rowindex="4"Minimal reproducible example
Steps to reproduce
aria-rowindexsituation.Environment
Vaadin version(s): 24.7.3
OS: Linux Mint
Browsers
Firefox, Chrome