angular/packages
Jessica Janiuk 3ec8a5c753 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:25 +00:00
..
animations refactor(core): Update tests for zoneless by default (#63672) 2025-09-09 15:07:24 -07:00
benchpress build: rename defaults2.bzl to defaults.bzl (#63384) 2025-08-25 15:45:46 -07:00
common build: add a noDuplicateEnumValue rule (#63483) 2025-09-10 22:16:11 +00:00
compiler refactor(core): dispatch enter and leave animations at the right times (#63710) 2025-09-10 22:24:31 +00:00
compiler-cli refactor(core): dispatch enter and leave animations at the right times (#63710) 2025-09-10 22:24:31 +00:00
core fix(core): Prevent leave animations on a move operation (#63745) 2025-09-12 15:21:25 +00:00
docs/di
elements refactor(core): Update tests for zoneless by default (#63672) 2025-09-09 15:07:24 -07:00
examples refactor(core): Update tests for zoneless by default (#63672) 2025-09-09 15:07:24 -07:00
forms refactor(core): Update tests for zoneless by default (#63672) 2025-09-09 15:07:24 -07:00
language-service build: rename defaults2.bzl to defaults.bzl (#63384) 2025-08-25 15:45:46 -07:00
localize build: rename defaults2.bzl to defaults.bzl (#63384) 2025-08-25 15:45:46 -07:00
misc/angular-in-memory-web-api build: rename defaults2.bzl to defaults.bzl (#63384) 2025-08-25 15:45:46 -07:00
platform-browser refactor(core): dispatch enter and leave animations at the right times (#63710) 2025-09-10 22:24:31 +00:00
platform-browser-dynamic refactor(core): Update tests for zoneless by default (#63672) 2025-09-09 15:07:24 -07:00
platform-server refactor(core): dispatch enter and leave animations at the right times (#63710) 2025-09-10 22:24:31 +00:00
private/testing build: rename defaults2.bzl to defaults.bzl (#63384) 2025-08-25 15:45:46 -07:00
router build: add a noDuplicateEnumValue rule (#63483) 2025-09-10 22:16:11 +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 (#63384) 2025-08-25 15:45:46 -07:00
upgrade refactor(core): Update tests for zoneless by default (#63672) 2025-09-09 15:07:24 -07:00
zone.js build: separate zone.js dependencies into their own directory (#63612) 2025-09-08 12:30:40 -07:00
BUILD.bazel build: rename defaults2.bzl to defaults.bzl (#63384) 2025-08-25 15:45:46 -07:00
circular-deps-test.conf.js docs(docs-infra): lift circular imports (#63186) 2025-08-19 07:58:47 +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 refactor: use zone.js from npm instead of packages/zone.js throughout repo (#61977) 2025-06-10 12:02:03 -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