web-components
web-components copied to clipboard
Grid column reordering error when cursor leaves the browser.
Description
I wanted to move the last grid column to first position, while doing that cursor left the browser for a moment and I got a javascript error at the top right corner: "TypeError: Cannot read properties of null (reading '_column')"
Full console stacktract:
vaadin-grid-column-reordering-mixin.js:255 Uncaught TypeError: Cannot read properties of null (reading '_column')
at GridElement._cellFromPoint (vaadin-grid-column-reordering-mixin.js:255:18)
at GridElement._onTrack (vaadin-grid-column-reordering-mixin.js:166:29)
at GridElement._onTrackEvent (vaadin-grid-column-reordering-mixin.js:121:12)
at _fire (gestures.js:682:87)
at trackFire (gestures.js:982:3)
at HTMLDocument.movefn (gestures.js:879:11)
Video: https://github.com/user-attachments/assets/6cfa169d-3664-4e7f-9bd0-82a22f4156a4
Expected outcome
no error
Minimal reproducible example
public class TestUI extends VerticalLayout {
public TestUI() {
Grid<List<String>> a = new Grid();
a.setItems(Arrays.asList(""));
add(a);
a.addColumn( l -> "A").setHeader("A").setWidth("200px");
a.addColumn( l -> "B").setHeader("B").setWidth("200px");
a.addColumn( l -> "C").setHeader("C").setWidth("200px");
a.setColumnReorderingAllowed(true);
a.setSizeFull();
setSizeFull();
}
}
Steps to reproduce
- add the snipet
- make the browser smaller.
- drag the last column to the first position, leave the browser with the cursor while doing that
Environment
Vaadin version(s): 14.10.11 OS: Windows10
Browsers
Chrome
The issue seems to be fixed on the latest version.