You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Grid] Cannot read properties of undefined (reading 'dragDisabled') #5177
I am making use of the Vaadin Grid Component. In some cases it only has 4 columns - but inside these columns I tend to have components and a few other controls.
I frequently encounter the error :
There seems to be an error in Vaadin Grid:
Cannot read properties of undefined (reading 'dragDisabled')
Please submit an issue to https://github.com/vaadin/flow-components/issues/new/choose
But there is no associated error on the server side. Also I am using the @Push mechanism to update it sometimes (using the appropriate UI.access() method etc).
In some cases the application simply carries on. In other cases, the whole session for that user is 'broken'.
Unclear as to how to debug further and give more information here.
Expected outcome
This error should not occur.
Or at least if it does - should specify what can be done to remedy.
Certainly should not hang the application.
Minimal reproducible example
Wish I could provide the application code. But it is quite complex.
Happy to add additional logging as appropriate. Please advise.
Steps to reproduce
Wish I could provide the application code. But it is quite complex.
Happy to add additional logging as appropriate. Please advise.
Environment
Vaadin version(s): 23.3.14
OS: Windows and Linux. Chrome Browser primarily. But also Edge.
Dear @jistennkamp, unfortunately it would be impossible to triage the issue without a reproduction example. The mentioned error could occur in multiple different scenarios.
I tested with older versions and it seems that the issue was introduced starting with version 23.3.13.
With version 23.3.12, the issue cannot be reproduced.
Apparently, grid.size can be 0 not only when there are no items to display. At least, I found that it's initially set to 0, which could be related to this regression because the mentioned error occurs during initialization:
grid.size=0;// To avoid NaN here and there before we get proper data
P.S. I tried to remove grid.size = 0 and it seemed to fix the JS error. However, it's important to more carefully consider possible consequences of this change.
changed the title [-]Encountering Error : "There seems to be an error in Vaadin Grid: Cannot read properties of undefined (reading 'dragDisabled')"[/-][+]Cannot read properties of undefined (reading 'dragDisabled')[/+]on Jul 4, 2023
changed the title [-]Cannot read properties of undefined (reading 'dragDisabled')[/-][+][Grid] Cannot read properties of undefined (reading 'dragDisabled')[/+]on Jul 4, 2023
Activity
yuriy-fix commentedon Jun 28, 2023
Dear @jistennkamp, unfortunately it would be impossible to triage the issue without a reproduction example. The mentioned error could occur in multiple different scenarios.
silvan-lincan commentedon Jun 30, 2023
Hello @yuriy-fix
I could reproduce the issue with Vaadin v23.3.13, v23.3.14 and v23.3.15.
Minimal reproducible example:
skeleton-starter-flow-23.zip
Steps to reproduce:
#setRowsDraggable(true)Browsers
Chrome
Safari
Firefox - I did not tested
I hope/wish this helps in opening an investigation, as we use draggable rows in all our grids.
Thank you.
silvan-lincan commentedon Jun 30, 2023
Hi,
I tested with older versions and it seems that the issue was introduced starting with version 23.3.13.
With version 23.3.12, the issue cannot be reproduced.
vursen commentedon Jul 4, 2023
I confirm that it's a regression introduced by #5040.
The related code fragment:
flow-components/vaadin-grid-flow-parent/vaadin-grid-flow/src/main/resources/META-INF/resources/frontend/gridConnector.js
Lines 393 to 396 in c8eced1
Apparently,
grid.sizecan be0not only when there are no items to display. At least, I found that it's initially set to0, which could be related to this regression because the mentioned error occurs during initialization:flow-components/vaadin-grid-flow-parent/vaadin-grid-flow/src/main/resources/META-INF/resources/frontend/gridConnector.js
Line 121 in c8eced1
P.S. I tried to remove
grid.size = 0and it seemed to fix the JS error. However, it's important to more carefully consider possible consequences of this change.[-]Encountering Error : "There seems to be an error in Vaadin Grid: Cannot read properties of undefined (reading 'dragDisabled')"[/-][+]Cannot read properties of undefined (reading 'dragDisabled')[/+][-]Cannot read properties of undefined (reading 'dragDisabled')[/-][+][Grid] Cannot read properties of undefined (reading 'dragDisabled')[/+]vursen commentedon Jul 4, 2023
Here is a simplified reproduction: