angular/packages
Theodore Brown 4f0221e193 fix(forms): improve select performance (#61949)
We defer the update until after rendering
is complete for two reasons: first, to avoid repeatedly calling
`writeValue` on every option element until we find the selected one
(could be the very last element). Second, to ensure that we perform the
write after the DOM elements have been created (this doesn't happen
until the end of change detection when animations are enabled).

This is needed to efficiently set the select value when adding/removing options. The
previous approach resulted in exponentially more `_compareValue` calls than the number
of option elements (issue angular#41330).

Finally, this PR fixes an issue with delayed element removal when using the animations
module (in all browsers). Previously when a selected option was removed (so no option
matched the ngModel anymore), Angular changed the select element value before actually
removing the option from the DOM. Then when the option was finally removed from the DOM,
the browser would change the select value to that of the first option, even though it
didn't match the ngModel (issue angular#18430). Note that this is still
somewhat of an application problem when using `ngModel`. The model value
still needs to be updated to a valid value when the selected value is
deleted or it will be out of sync with the DOM.

Fixes #41330, fixes #18430.

PR Close #61949
2025-06-10 13:13:13 -07:00
..
animations build: replace all ng_package with new rule from rules_angular (#61843) 2025-06-04 09:13:41 +00:00
benchpress build: update cross-repo angular dependencies to ^20.1.0-next (#61880) 2025-06-05 14:08:33 +02:00
common refactor: use zone.js from npm instead of packages/zone.js throughout repo (#61977) 2025-06-10 12:02:03 -07:00
compiler build: replace all ng_package with new rule from rules_angular (#61843) 2025-06-04 09:13:41 +00:00
compiler-cli fix(compiler-cli): add signal checks to handle negated calls (#59970) 2025-06-09 09:01:06 -07:00
core refactor: use zone.js from npm instead of packages/zone.js throughout repo (#61977) 2025-06-10 12:02:03 -07:00
docs/di docs: remove outdated/unsupported webworker doc (#49856) 2023-04-17 14:01:41 +00:00
elements refactor: use zone.js from npm instead of packages/zone.js throughout repo (#61977) 2025-06-10 12:02:03 -07:00
examples refactor: use zone.js from npm instead of packages/zone.js throughout repo (#61977) 2025-06-10 12:02:03 -07:00
forms fix(forms): improve select performance (#61949) 2025-06-10 13:13:13 -07:00
language-service feat(language-service): Support importing the external module's export about the angular metadata. (#61122) 2025-06-04 14:11:20 -04:00
localize build: update all non-major dependencies (#61700) 2025-06-05 10:14:17 +02:00
misc/angular-in-memory-web-api build: update cross-repo angular dependencies to ^20.1.0-next (#61880) 2025-06-05 14:08:33 +02:00
platform-browser refactor: use zone.js from npm instead of packages/zone.js throughout repo (#61977) 2025-06-10 12:02:03 -07:00
platform-browser-dynamic build: replace all ng_package with new rule from rules_angular (#61843) 2025-06-04 09:13:41 +00:00
platform-server build: remove unnecessary zone.js dep from various build targets (#61901) 2025-06-05 09:12:27 -07:00
private/testing build: replace all ng_package with new rule from rules_angular (#61843) 2025-06-04 09:13:41 +00:00
router build: replace all ng_package with new rule from rules_angular (#61843) 2025-06-04 09:13:41 +00:00
service-worker Revert "refactor(service-worker): make SwPush and SwUpdate tree-shakable (#61670)" (#61923) 2025-06-06 07:48:45 -07:00
ssr refactor(core): add REQUEST, RESPONSE_INIT and REQUEST_CONTEXT tokens (#58669) 2024-11-14 14:21:21 -08:00
upgrade refactor: use zone.js from npm instead of packages/zone.js throughout repo (#61977) 2025-06-10 12:02:03 -07:00
zone.js refactor: use zone.js from npm instead of packages/zone.js throughout repo (#61977) 2025-06-10 12:02:03 -07:00
BUILD.bazel refactor: use zone.js from npm instead of packages/zone.js throughout repo (#61977) 2025-06-10 12:02:03 -07:00
circular-deps-test.conf.js build: remove circular deps goldens (#60021) 2025-02-19 21:01:31 +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 refactor: use zone.js from npm instead of packages/zone.js throughout repo (#61977) 2025-06-10 12:02:03 -07:00
tsconfig-legacy-saucelabs.json feat(core): support TypeScript 5.5 (#56096) 2024-05-29 15:33:33 +02:00
tsconfig-test.json
tsconfig-tsec-base.json refactor(compiler): remove empty empty string suffix from interpolation instructions (#60066) 2025-03-10 16:31:34 -07:00
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