Title: QueryList not sorted according to the actual state · Issue #42519 · angular/angular · GitHub
Open Graph Title: QueryList not sorted according to the actual state · Issue #42519 · angular/angular
X Title: QueryList not sorted according to the actual state · Issue #42519 · angular/angular
Description: Bug Report Affected Package This issue is caused by package @angular/core. Is this a regression? Not my case. Description I display a list of components via * ngFor and query them with ViewChildren. The list can be reordered (from the da...
Open Graph Description: Bug Report Affected Package This issue is caused by package @angular/core. Is this a regression? Not my case. Description I display a list of components via * ngFor and query them with ViewChildren...
X Description: Bug Report Affected Package This issue is caused by package @angular/core. Is this a regression? Not my case. Description I display a list of components via * ngFor and query them with ViewChildren...
Opengraph URL: https://github.com/angular/angular/issues/42519
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"QueryList not sorted according to the actual state","articleBody":"# Bug Report\r\n\r\n### Affected Package\r\nThis issue is caused by package `@angular/core`.\r\n\r\n### Is this a regression?\r\nNot my case.\r\n\r\n### Description\r\nI display a list of components via `* ngFor` and query them with` ViewChildren`.\r\nThe list can be reordered (from the data), visually it's ok, the `QueryList` triggers` changes` (it's ok too), but the list in the `QueryList` is not sorted, is the same as at the beginning.\r\n\r\nI found the cause, each component is encapsulated in an `ng-template` in the` * ngFor`. If I make my components direct children of the `* ngFor`, it works. \r\n\r\nI made a minimal reproduction with a sorted list `1, 2, 3, 4`, I reorganized` 3, 4, 1, 2` but in the `QueryList` it is still` 1, 2, 3, 4` .\r\n\r\n\r\n## Minimal Reproduction\r\nhttps://ng-run.com/edit/B0RMoh8QgGE9Syf3GBSf?open=app%2Fapp.component.ts&layout=1\r\n\r\n\r\n## Exception or Error\r\nNone.\r\n\r\n\r\n## Your Environment\r\n\r\n**Angular Version:**\r\n\u003cpre>\u003ccode>\r\nAngular CLI: 11.2.13\r\nNode: 14.15.4\r\nOS: win32 x64\r\n\r\nAngular: 11.2.14\r\n... animations, common, compiler, compiler-cli, core, forms\r\n... language-service, localize, platform-browser\r\n... platform-browser-dynamic, router\r\nIvy Workspace: Yes\r\n\r\nPackage Version\r\n---------------------------------------------------------\r\n@angular-devkit/architect 0.1102.13\r\n@angular-devkit/build-angular 0.1102.13\r\n@angular-devkit/core 11.2.13\r\n@angular-devkit/schematics 11.2.13\r\n@angular/cdk 11.2.13\r\n@angular/cli 11.2.13\r\n@angular/flex-layout 11.0.0-beta.33\r\n@schematics/angular 11.2.13\r\n@schematics/update 0.1102.13\r\nrxjs 6.6.3\r\ntypescript 4.0.3\r\n\u003c/code>\u003c/pre>\r\n\r\n**Anything else relevant?**\r\nNothing.","author":{"url":"https://github.com/DRYmag","@type":"Person","name":"DRYmag"},"datePublished":"2021-06-08T14:51:29Z","url":"https://github.com/angular/angular/issues/42519"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9c1d6bc2-8263-1027-d1c8-483031e9e46f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9E34:34CAB:15BAADB:1BBE19D:6B0137C5 |
| html-safe-nonce | 5a9454ee70cf7f9c6ae7b343bd3bd62471040ece8d88de50b0d5c88118ce606f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RTM0OjM0Q0FCOjE1QkFBREI6MUJCRTE5RDo2QjAxMzdDNSIsInZpc2l0b3JfaWQiOiIzOTk5MjkzMTI0ODQ0MjcxNTU3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | e70507fe11d5497ba56b4702a828cd19695218d497cbd87414c054f1c497b17d |
| hovercard-subject-tag | issue:915138690 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/42519/issue_layout |
| twitter:image | https://opengraph.githubassets.com/142d99bf8cab1fe28d95ebc400394b987dd2b4857d362fa90031a4adfe0ab5b0/angular/angular/issues/42519 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/142d99bf8cab1fe28d95ebc400394b987dd2b4857d362fa90031a4adfe0ab5b0/angular/angular/issues/42519 |
| og:image:alt | Bug Report Affected Package This issue is caused by package @angular/core. Is this a regression? Not my case. Description I display a list of components via * ngFor and query them with ViewChildren... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | DRYmag |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width