vaadin / web-components

A set of high-quality standards based web components for enterprise web applications. Part of Vaadin 20+
https://vaadin.com/docs/latest/components
462 stars 83 forks source link

Grid is not draggable in Chromium-Browsers #7985

Open paodb opened 1 week ago

paodb commented 1 week ago

Description

When try to drag and drop a grid with a large number of Items, the browser tab crashes completely without explicit error.

This occurs in Chrome and Edge while Firefox works perfectly with no issues.

Between 1000 and 2000 items, the drag still works but with significant delay. From about 2000+ items the tab crashes completely.

Also tested lazy data providers but the issue persists either way.

Expected outcome

The Grid should be draggable without any performance issues or crashes.

Minimal reproducible example

@Route("tst")
public class TestView extends VerticalLayout {
   public TestView() {
      Grid<String> grid = new Grid<>(String.class);
      ArrayList<String> list = new ArrayList<>();
      for (int i = 0; i < 5000; i++) {
         list.add(i + "");
      }
      grid.setItems(list);
      DragSource<Grid> gridDragSource = DragSource.create(grid);
      gridDragSource.setDraggable(true);
      add(grid);
   }
}

Steps to reproduce

  1. Add the snippet above in a Vaadin 24.4.13 application
  2. Run the application and try to drag the Grid using Chrome browser. It will crash and show an error "something went wrong when displaying this webpage".

Environment

Vaadin version(s): 24.4.13, 24.5.0 OS: Windows 10, 11 Browser version: Chrome 129.0.6668.101; Edge 129.0.2792.89; Firefox 131.0.3

Browsers

Chrome, Edge

ugur-vaadin commented 21 hours ago

There is an open PR that should possibly fix the issue.