Ryware / ngx-drag-and-drop-lists

Angular drag and drop component for lists
MIT License
49 stars 40 forks source link

NativeElement is undefined in dnd-draggable.js:21 #72

Closed Lospepes closed 4 years ago

Lospepes commented 4 years ago

Hello,

Since I updated my project dependencies to the latest version :

"dependencies": { "@angular-devkit/build-angular": "~0.901.7", "@angular/animations": "^9.1.9", "@angular/cdk": "^9.2.4", "@angular/common": "^9.1.9", "@angular/compiler": "^9.1.9", "@angular/core": "^9.1.9", "@angular/forms": "^9.1.9", "@angular/material": "^9.2.4", "@angular/platform-browser": "^9.1.9", "@angular/platform-browser-dynamic": "^9.1.9", "@angular/router": "^9.1.9", "core-js": "^2.4.1", "ngx-drag-and-drop-lists": "^1.3.1", "rxjs": "^6.5.5", "tslib": "^1.10.0", "zone.js": "~0.10.2" }, "devDependencies": { "@angular/cli": "^9.1.7", "@angular/compiler-cli": "^9.1.9", "@angular/language-service": "^9.1.9", "@types/jasmine": "~3.5.10", "@types/jasminewd2": "~2.0.8", "@types/node": "^12.11.1", "codelyzer": "^5.1.2", "jasmine-core": "~2.8.0", "jasmine-spec-reporter": "~4.2.1", "karma": "~5.0.9", "karma-chrome-launcher": "~2.2.0", "karma-coverage-istanbul-reporter": "^3.0.3", "karma-jasmine": "~3.3.1", "karma-jasmine-html-reporter": "^0.2.2", "protractor": "~5.1.2", "ts-node": "~4.1.0", "tslint": "~5.9.1", "typescript": "~3.8.3" }

I'm getting this error :

ERROR TypeError: Cannot read property 'setAttribute' of undefined at new DndDraggable (dnd-draggable.js:21)

I tried to downgrade ngx-drag-and-drop-lists and to find any changes on the documenttation.

Do you have an advice to help me ? Please

Thank you in advance for your help

geferon commented 4 years ago

Same issue here

sc-mtp commented 4 years ago

I have the same issue. The error lies in DndDraggable. There are multiple calls to this.nativeElement.nativeElement which result in the mentioned TypeError. Replace those occurrences with this.nativeElement and the code will run again.

misha130 commented 4 years ago

Alright, resolved released a 1.3.2. Thank you