Skip to content

Commit

Permalink
fix(cdk/drag-drop): error when preview is destroyed before animation …
Browse files Browse the repository at this point in the history
…completes (#23662)

(cherry picked from commit 3913883)
  • Loading branch information
YugasVasyl authored and mmalerba committed Sep 30, 2021
1 parent 9056d95 commit 8518920
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cdk/drag-drop/drag-ref.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@ export class DragRef<T = any> {
const handler = ((event: TransitionEvent) => {
if (!event || (_getEventTarget(event) === this._preview &&
event.propertyName === 'transform')) {
this._preview.removeEventListener('transitionend', handler);
this._preview?.removeEventListener('transitionend', handler);
resolve();
clearTimeout(timeout);
}
Expand Down

0 comments on commit 8518920

Please sign in to comment.