Skip to content

Cannot read property "style" of null _rootElement - cdkDrag (drag-drop.es5.js) #15827

Closed
@PastoTreering

Description

@PastoTreering

What is the expected behavior?

Return out of _pointerMove event (and possibly others, but we're logging _pointerMove crashes only at the moment) if _this._rootElement is null or undefined when dragging without _dropContainer.

What is the current behavior?

_rootElement can be null in the _pointerMove method within drag-drop.es5.js. Throwing an error on line 312 of drag-drop.es5.js when attempting to access "style" of null (_root._rootElement). Possibly event is continuing to fire when parent node has been destroyed or removed?

What are the steps to reproduce?

Unknown, but logs show it is happening mostly on mobile devices (but not exclusively).

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

Angular cdk 7.3.7 +

Is there anything else we should know?

Sorry for the lack of reproducibility, but some safety here for the existence of _rootElement wouldn't hurt imo.

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