Skip to content

CDK Drag and Drop: Unhandled Promise rejection in _cleanupDragArtifacts when ngbTooltip is used on cdkDrag element. #18205

@rshanley-dig

Description

@rshanley-dig

Reproduction

Stackblitz: https://stackblitz.com/edit/angular-wkr9so

Steps to reproduce:

  1. Drag element from 'To do' to 'Done'

Expected Behavior

No exception and it gets inserted normally into the 'Done' list. It works when there is no ngbTooltip used.

Actual Behavior

Element does not get inserted in 'Done' list and Exception occurs in _cleanupDragArtifacts (because parentNode is undefined where it is expected to be defined):

Unhandled Promise rejection:
Cannot read property 'insertBefore' of null
; Zone:
<root>
; Task:
Promise.then
; Value:
Error: Cannot read property 'insertBefore' of null
TypeError: Cannot read property 'insertBefore' of null
at DragRef._cleanupDragArtifacts (https://angular-wkr9so.stackblitz.io/turbo_modules/@angular/[email protected]/bundles/cdk-drag-drop.umd.js:1032:63)
at eval (https://angular-wkr9so.stackblitz.io/turbo_modules/@angular/[email protected]/bundles/cdk-drag-drop.umd.js:861:23)
at ZoneDelegate.invoke (https://angular-wkr9so.stackblitz.io/turbo_modules/[email protected]/dist/zone.js:391:26)
at Zone.run (https://angular-wkr9so.stackblitz.io/turbo_modules/[email protected]/dist/zone.js:150:43)
at eval (https://angular-wkr9so.stackblitz.io/turbo_modules/[email protected]/dist/zone.js:910:34)
at ZoneDelegate.invokeTask (https://angular-wkr9so.stackblitz.io/turbo_modules/[email protected]/dist/zone.js:423:31)
at Zone.runTask (https://angular-wkr9so.stackblitz.io/turbo_modules/[email protected]/dist/zone.js:195:47)
at drainMicroTaskQueue (https://angular-wkr9so.stackblitz.io/turbo_modules/[email protected]/dist/zone.js:601:35)
at ZoneTask.invokeTask [as invoke] (https://angular-wkr9so.stackblitz.io/turbo_modules/[email protected]/dist/zone.js:502:21)
at invokeTask (https://angular-wkr9so.stackblitz.io/turbo_modules/[email protected]/dist/zone.js:1693:14)
at HTMLDivElement.globalZoneAwareCallback (https://angular-wkr9so.stackblitz.io/turbo_modules/[email protected]/dist/zone.js:1719:17)

Environment

  • Angular: 8.2.9
  • CDK/Material: 8.2.2
  • Browser(s): Chrome 79.0.3945.117
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows 10

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions