Skip to content

bug(drag-drop): Unreliable drop-zone detection & markup structure. #19085

Closed
@matthewerwin

Description

@matthewerwin

Reproduction

Use StackBlitz to reproduce your issue:

https://stackblitz.com/edit/angular-rf6gg6

Steps to reproduce:

  1. Look at the stack blitz.
  2. Markup has an effect on ability to even start a drag without any console or compile indicator that cdkDrag and cdkDropList cannot be on the same drag element (they could be in v8 --v9 allows them on the same container for the "drop element")
  3. Exit/Enter aren't reliably detected based on the client-rect

Expected Behavior

What behavior were you expecting to see?

  • Drop zone container should always be detected as soon as the mouse goes over the element.
  • If use of cdkDrag/cdkDropList combo only works in certain situations (e.g. codebase looks for this._container on a dragref in v9...which appears to only get set if cdkDropList is on a parent element). That should either be documented and also the compiler should write an error to the console...or the code should be adjusted to set this._container to the element itself to handle the directive combo on the same element.

Actual Behavior

What behavior did you actually see?

  • No errors to console or at compile time with directives appended in any fashion.
  • v9 does not detect a drop-zone accurately at all for entry or exit. Shaking the mouse a bunch over drop zones or redragging repeatedly will randomly then detect it correctly...though continuing to drag around shows the same inability to detect the drop-zones.

Environment

  • Angular: v9.1.2 (really any v9.x for the drop-zone detection)
  • CDK/Material: v9.2.1
  • Browser(s): 80.0.3987.149
  • Operating System (e.g. Windows, macOS, Ubuntu): MacOS 10.14.6

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