angular/packages
Jessica Janiuk a4001c440f fix(core): Prevent leave animations on a move operation (#63745)
When a user has `animate.leave` on a list of items in a `@for`, but are only showing a subset using a computed, removing the second to last item results in a move operation on the last item. There's no native atomic move API in the browser. So this results in the element being detached and attached at its new index. The detaching of the node resulted in leave animations firing.
This fix addresses this by adding a flag in the `LView[ANIMATIONS]` `AnimationLViewData` interface to allow for skipping animations. During list reconciliation, we set this flag so that the animations are skipped over. The flag is flipped back after the move operation is complete.

There is one complication that results from this. The index adjustment of elements in the list happens synchronously while the leave animation is asynchronous. This results in the leaving item getting shifted to the end of the list. This is not ideal but likely can be addressed in a future refactor.

fixes: #63544

PR Close #63745
2025-09-12 15:21:24 +00:00
..
animations refactor(core): Update tests for zoneless by default (#63668) 2025-09-09 14:41:56 -07:00
benchpress build: rename defaults2.bzl to defaults.bzl (#63383) 2025-08-25 15:45:01 -07:00
common refactor(common): improve typing of ngComponentOutletContent (#63674) 2025-09-10 22:26:27 +00:00
compiler refactor(core): dispatch enter and leave animations at the right times (#63450) 2025-09-10 22:24:00 +00:00
compiler-cli refactor(core): dispatch enter and leave animations at the right times (#63450) 2025-09-10 22:24:00 +00:00
core fix(core): Prevent leave animations on a move operation (#63745) 2025-09-12 15:21:24 +00:00
docs/di
elements refactor(core): Update tests for zoneless by default (#63668) 2025-09-09 14:41:56 -07:00
examples refactor(core): Update tests for zoneless by default (#63668) 2025-09-09 14:41:56 -07:00
forms refactor(core): Update tests for zoneless by default (#63668) 2025-09-09 14:41:56 -07:00
language-service feat(compiler-cli): enable type checking of host bindings by default (#63654) 2025-09-09 14:34:29 -07:00
localize build: update all non-major dependencies (#63661) 2025-09-10 07:11:54 -07:00
misc/angular-in-memory-web-api build: rename defaults2.bzl to defaults.bzl (#63383) 2025-08-25 15:45:01 -07:00
platform-browser refactor(core): dispatch enter and leave animations at the right times (#63450) 2025-09-10 22:24:00 +00:00
platform-browser-dynamic refactor(core): Update tests for zoneless by default (#63668) 2025-09-09 14:41:56 -07:00
platform-server refactor(core): dispatch enter and leave animations at the right times (#63450) 2025-09-10 22:24:00 +00:00
private/testing build: rename defaults2.bzl to defaults.bzl (#63383) 2025-08-25 15:45:01 -07:00
router refactor(router): update error checks extending error (#63487) 2025-09-11 16:55:58 +00:00
service-worker refactor(bazel): reduce build deps (#63348) 2025-08-28 09:16:10 -07:00
ssr/docs build: rename defaults2.bzl to defaults.bzl (#63383) 2025-08-25 15:45:01 -07:00
upgrade refactor(core): Update tests for zoneless by default (#63668) 2025-09-09 14:41:56 -07:00
zone.js build: update all non-major dependencies (#63661) 2025-09-10 07:11:54 -07:00
BUILD.bazel build: configure signal forms for release (#63458) 2025-08-29 14:31:35 -07:00
circular-deps-test.conf.js docs(docs-infra): lift circular imports (#63186) 2025-08-19 07:58:45 +00:00
empty.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
goog.d.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
license-banner.txt docs: update license year (#59883) 2025-03-04 19:36:47 +00:00
package.json build: prepare for compiler-cli to be using ts_project (#61181) 2025-05-09 15:59:46 +00:00
README.md docs: fix links to docs (#57391) 2024-08-19 09:20:15 -07:00
system.d.ts refactor: update packages/core:{core,src} to ts_project (#61275) 2025-05-14 12:01:51 +00:00
tsconfig-build.json build: migrate to using new jasmine_test (#62131) 2025-06-19 10:06:27 +02:00
tsconfig-legacy-saucelabs.json feat(core): support TypeScript 5.5 (#56096) 2024-05-29 15:33:33 +02:00
tsconfig-test.json
tsconfig.json feat(compiler-cli): enable type checking of host bindings by default (#63654) 2025-09-09 14:34:29 -07:00
tsec-exemption.json
types.d.ts build: move private testing helpers outside platform-browser/testing (#61472) 2025-05-20 10:00:43 +00:00

Angular

The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.

Usage information and reference details can be found in Angular documentation.

License: MIT