Title: Renderer should not clear host contents when using Shadow DOM · Issue #24859 · angular/angular · GitHub
Open Graph Title: Renderer should not clear host contents when using Shadow DOM · Issue #24859 · angular/angular
X Title: Renderer should not clear host contents when using Shadow DOM · Issue #24859 · angular/angular
Description: When using Angular Elements with the new ViewEncapsulation.ShadowDom option, the renderer clears the pre-existing textContent of the selected root node: https://github.com/angular/angular/blob/master/packages/platform-browser/src/dom/dom...
Open Graph Description: When using Angular Elements with the new ViewEncapsulation.ShadowDom option, the renderer clears the pre-existing textContent of the selected root node: https://github.com/angular/angular/blob/mast...
X Description: When using Angular Elements with the new ViewEncapsulation.ShadowDom option, the renderer clears the pre-existing textContent of the selected root node: https://github.com/angular/angular/blob/mast...
Opengraph URL: https://github.com/angular/angular/issues/24859
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Renderer should not clear host contents when using Shadow DOM","articleBody":"When using Angular Elements with the new `ViewEncapsulation.ShadowDom` option, the renderer clears the pre-existing textContent of the selected root node: https://github.com/angular/angular/blob/master/packages/platform-browser/src/dom/dom_renderer.ts#L144\r\n\r\nThis prevents developers from using `\u003cslot>` elements to do runtime content projection, eg\r\n```ts\r\n@Component({\r\n template: '\u003cslot>\u003c/slot>',\r\n encapsulation: ViewEncapsulation.Native,\r\n styles: [ `:host { color: red } `]\r\n})\r\nclass MyComponent {}\r\n```\r\n```html\r\n\u003cmy-component>ProjectedText\u003c/my-component>\r\n```\r\n\r\nThis is the desired behavior when using Angular in \"SPA\" mode, where the app will own the whole DOM, but prevents runtime composition with Elements.\r\n\r\nNormally, this could be handled in the Shadow DOM renderer, but because this selectRootElement() call happens from inside the view services,: https://github.com/angular/angular/blob/master/packages/core/src/view/services.ts#L756\r\nthe *default* renderer is used here, before the component is booted (?), there's no way to know if this is a ShadowDOM component or not, and the default implementation is used.\r\n","author":{"url":"https://github.com/robwormald","@type":"Person","name":"robwormald"},"datePublished":"2018-07-12T18:53:43Z","url":"https://github.com/angular/angular/issues/24859"}
| 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:c79fb880-ed5a-fd90-86c2-0eed70afcd94 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B932:D5AA4:179AFEE:1F6F56F:6B013970 |
| html-safe-nonce | 3dd0c3c2f257ab4d263c92759e58f4f751ccba4692a8832907d34efdd7fd2eb2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOTMyOkQ1QUE0OjE3OUFGRUU6MUY2RjU2Rjo2QjAxMzk3MCIsInZpc2l0b3JfaWQiOiI0MDY5OTg3MTE0MDEwMzYwMTc2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | dc6c4e3d89bc97759b0fb37fed18f012445cf2fcac67dd5d4c12760f23c011d6 |
| hovercard-subject-tag | issue:340757538 |
| 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/24859/issue_layout |
| twitter:image | https://opengraph.githubassets.com/31b1464fca36f7208a57719c44ec0edffdfd17b3fb81acc52254e5235d0cc1e2/angular/angular/issues/24859 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/31b1464fca36f7208a57719c44ec0edffdfd17b3fb81acc52254e5235d0cc1e2/angular/angular/issues/24859 |
| og:image:alt | When using Angular Elements with the new ViewEncapsulation.ShadowDom option, the renderer clears the pre-existing textContent of the selected root node: https://github.com/angular/angular/blob/mast... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | robwormald |
| 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