Skip to content

Items disappearing on drag-and-drop #67257

@nickschwartz-jpg

Description

@nickschwartz-jpg

Which @angular/* package(s) are the source of the bug?

animations

Is this a regression?

Yes

Description

Our Angular web app allows users to drag-and-drop components to reorder them.

Recently, we noticed that dragging-and-dropping was causing items to disappear from the page entirely!

Please see the attached mp4 video for a demonstration of this behavior against a minimal repro (stackblitz link for this repro is included below)


We suspect it was caused by a change in the animations package, and we were able to mitigate the "disappearing" issue by removing these two lines from the relevant HTML snippet (i.e. disabling the animation):

animate.enter="ease-in-animation"
animate.leave="ease-out-animation"

I believe this behavior is new as of release 21.2.0-rc.0 - I've pinned all Angular packages to that version in the repro link below

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/stackblitz-starters-2puwya73?file=src%2Fapp.component.html

Please provide the exception or error you saw


Please provide the environment you discovered this bug in (run ng version)

$ ng version

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI       : 21.2.0-rc.0
Angular           : 21.2.0-rc.0
Node.js           : 20.19.1
Package Manager   : npm 10.8.2
Operating System  : linux x64

┌───────────────────────────┬───────────────────┬───────────────────┐
│ Package                   │ Installed Version │ Requested Version │
├───────────────────────────┼───────────────────┼───────────────────┤
│ @angular/animations       │ 21.2.0-rc.0       │ 21.2.0-rc.0       │
│ @angular/build            │ 21.2.0-rc.0       │ 21.2.0-rc.0       │
│ @angular/cdk              │ 21.2.0-rc.0       │ 21.2.0-rc.0       │
│ @angular/cli              │ 21.2.0-rc.0       │ 21.2.0-rc.0       │
│ @angular/common           │ 21.2.0-rc.0       │ 21.2.0-rc.0       │
│ @angular/compiler         │ 21.2.0-rc.0       │ ^21.2.0-rc.0      │
│ @angular/compiler-cli     │ 21.2.0-rc.0       │ 21.2.0-rc.0       │
│ @angular/core             │ 21.2.0-rc.0       │ 21.2.0-rc.0       │
│ @angular/forms            │ 21.2.0-rc.0       │ 21.2.0-rc.0       │
│ @angular/platform-browser │ 21.2.0-rc.0       │ 21.2.0-rc.0       │
│ @angular/router           │ 21.2.0-rc.0       │ 21.2.0-rc.0       │
│ rxjs                      │ 7.8.2             │ ^7.8.1            │
│ typescript                │ 5.9.3             │ ^5.9.3            │
└───────────────────────────┴───────────────────┴───────────────────┘

Anything else?

drag_and_drop_disappearing_items.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: coreIssues related to the framework runtimecore: animationsIssues related to `animate.enter` and `animate.leave`

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions