Skip to content

Drag And Drop Angular Material Table on first drop #17868

Closed
@PedroRamirezTOR

Description

@PedroRamirezTOR

Bug:

I have a mat-table in a div container that is only created when table datasource is not empty with an ngIf. So when datasource is not empty and I try to drag and drop a row, first time I receive currentposition with -1 value on drop event. So first time no drag and drop is made. The following time the behavior is normal. Moreover, I realised that If table is shown and I click on a button with no functionality the drag and drop is made right on first time.

You could find more details on:
https://stackoverflow.com/questions/59127462/angular-material-mattable-drag-and-drop

Any idea? Thanks!

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

"@angular/animations": "^7.0.4",
"@angular/cdk": "^7.1.0",
"@angular/common": "~7.0.0",
"@angular/compiler": "~7.0.0",
"@angular/core": "~7.0.0",
"@angular/forms": "~7.0.0",
"@angular/http": "~7.0.0",
"@angular/material": "^7.1.0",
"@angular/platform-browser": "~7.0.0",
"@angular/platform-browser-dynamic": "~7.0.0",
"@angular/router": "~7.0.0",
"@ngx-translate/core": "^11.0.1",
"@ngx-translate/http-loader": "^4.0.0",
"angular-datatables": "^7.0.0",
"angular-mocks": "^1.7.5",
"angularjasper2": "0.0.3",
"bootstrap": "^4.1.3",
"canvas2image": "^1.0.5",
"core-js": "^2.5.4",
"datatables.net": "^1.10.19",
"datatables.net-dt": "^1.10.19",
"hammerjs": "^2.0.8",
"html2canvas": "^1.0.0-alpha.12",
"html2pdf.js": "^0.9.1",
"jquery": "^3.3.1",
"jspdf": "^1.5.3",
"jspdf-autotable": "^3.2.10",
"ng-mocks": "^7.1.3",
"ngx-mat-select-search": "^2.0.0",
"rxjs": "~6.3.3",
"rxjs-compat": "^6.3.3",
"tslib": "^1.10.0",
"tslint-sonarts": "^1.8.0",
"typescript-compiler": "^1.4.1-2",
"zone.js": "~0.8.26"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions