Description
Reproduction scenario is trivial. This can happen in muli-user environments where data updates are pushed and merged live.
Reproduction
https://stackblitz.com/edit/components-issue-crtxst?file=src%2Fapp%2Fexample-component.html
- Open repro - there are 4 buttons,
- Wait 3 seconds - there are 2 different buttons. They can be dragged,
- Now refresh the page, and as soon as it loads start dragging "Button 1". Hold it,
- After 3 seconds model is updated, dragging is cancelled, and dragging is no longer possible.
On stackblitz, I don't see any errors logged. However, on my production app, I got something logged via Sentry that points to this transpiled piece of code in fesm2015/drag-drop.js:
1078 (event) => {
1079 if (!event || (event.target === this._preview && event.propertyName === 'transform')) {
1080 this._preview.removeEventListener('transitionend', handler);
1081 resolve();
1082 clearTimeout(timeout);
1083 }
1084 }))));
with error being:
TypeError: Cannot read property 'removeEventListener' of null
Expected Behavior
Dragging should be possible with new items
Actual Behavior
Dragging doesn't work until page is reloaded
Environment
- Angular: 9.0.2
- CDK/Material: 9.0.1
- Browser(s): Chrome 80
- Operating System (e.g. Windows, macOS, Ubuntu): Ubuntu