Skip to content

bug(CdkDrag): CdkDrag stays outside the boundary if it's size change #30325

Closed
@gnemeth-ibl

Description

@gnemeth-ibl

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

If the size of the drag boundary changes, the draggable element does not recalculate its position and remains outside the boundary.

Reproduction

StackBlitz link: https://stackblitz.com/edit/l8npyx4z?file=src%2Fexample%2Fcdk-drag-drop-boundary-example.html,src%2Fexample%2Fcdk-drag-drop-boundary-example.ts
Steps to reproduce:

  1. Drag the element to the right edge
  2. Click the resize button
  3. The drag element is outside the boundary

Image

Expected Behavior

The drag element should stay inside the boundary,

Actual Behavior

It stays outside the boundary.

Environment

  • Angular: 19.0.5
  • CDK/Material: 19.0.5
  • Browser(s): Chrome 131.0.6778.265
  • Operating System (e.g. Windows, macOS, Ubuntu): Win 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: cdk/drag-dropfeatureThis issue represents a new feature or feature request rather than a bug or bug fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions